@@ -502,8 +502,8 @@ void write(WriteAttributeToObjectNode writeAttributeToObjectNode, ReadAttributeF
502
502
* that we cannot easily do the same since we have two separate sets of slots: HPy
503
503
* slots and legacy slots. Right now, the HPy slots have precedence.
504
504
*/
505
- if (!keyExists (readAttributeFromObjectNode , enclosingType , key )) {
506
- writeAttributeToObjectNode .execute (enclosingType , key , value );
505
+ if (!keyExists (readAttributeFromObjectNode , enclosingType , prop . key )) {
506
+ writeAttributeToObjectNode .execute (enclosingType , prop . key , prop . value );
507
507
}
508
508
}
509
509
}
@@ -948,15 +948,17 @@ static HPyProperty doIt(GraalHPyContext context, Object enclosingType, Object sl
948
948
default :
949
949
// this is the generic slot case
950
950
String attributeKey = slot .getAttributeKey ();
951
- if (attributeKey != null && !HPyProperty .keyExists (readAttributeToObjectNode , enclosingType , attributeKey )) {
952
- Object pfuncPtr = callHelperFunctionNode .call (context , GraalHPyNativeSymbol .GRAAL_HPY_LEGACY_SLOT_GET_PFUNC , slotDef );
953
- /*
954
- * TODO(fa): Properly determine if 'pfuncPtr' is a native function pointer
955
- * and thus if we need to do result and argument conversion.
956
- */
957
- PBuiltinFunction method = PExternalFunctionWrapper .createWrapperFunction (attributeKey , pfuncPtr , enclosingType , 0 ,
958
- slot .getSignature (), PythonLanguage .get (raiseNode ), factory , true );
959
- writeAttributeToObjectNode .execute (enclosingType , attributeKey , method );
951
+ if (attributeKey != null ) {
952
+ if (!HPyProperty .keyExists (readAttributeToObjectNode , enclosingType , attributeKey )) {
953
+ Object pfuncPtr = callHelperFunctionNode .call (context , GraalHPyNativeSymbol .GRAAL_HPY_LEGACY_SLOT_GET_PFUNC , slotDef );
954
+ /*
955
+ * TODO(fa): Properly determine if 'pfuncPtr' is a native function
956
+ * pointer and thus if we need to do result and argument conversion.
957
+ */
958
+ PBuiltinFunction method = PExternalFunctionWrapper .createWrapperFunction (attributeKey , pfuncPtr , enclosingType , 0 ,
959
+ slot .getSignature (), PythonLanguage .get (raiseNode ), factory , true );
960
+ writeAttributeToObjectNode .execute (enclosingType , attributeKey , method );
961
+ }
960
962
} else {
961
963
// TODO(fa): implement support for remaining legacy slot kinds
962
964
CompilerDirectives .transferToInterpreterAndInvalidate ();
0 commit comments