Skip to content

Commit b845c0f

Browse files
committed
make sure we try to read from a NativeClass before trying a foreign object
1 parent 3d64a3e commit b845c0f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/attributes/ReadAttributeFromObjectNode.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ protected PNone readUnboxed(Object object, Object key) {
183183

184184
@GenerateUncached
185185
protected abstract static class ReadAttributeFromObjectNotTypeNode extends ReadAttributeFromObjectNode {
186-
@Specialization(guards = {"!isHiddenKey(key)"})
186+
@Specialization(guards = {"!isHiddenKey(key)"}, insertBefore = "readForeign")
187187
protected Object readNativeObject(PythonNativeObject object, Object key,
188188
@Cached HashingCollectionNodes.GetDictStorageNode getDictStorage,
189189
@Cached("create()") GetObjectDictNode getNativeDict,
@@ -199,7 +199,7 @@ protected Object fallback(Object object, Object key) {
199199

200200
@GenerateUncached
201201
protected abstract static class ReadAttributeFromObjectTpDictNode extends ReadAttributeFromObjectNode {
202-
@Specialization(guards = {"!isHiddenKey(key)"})
202+
@Specialization(guards = {"!isHiddenKey(key)"}, insertBefore = "readForeign")
203203
protected Object readNativeClass(PythonNativeClass object, Object key,
204204
@Cached HashingCollectionNodes.GetDictStorageNode getDictStorage,
205205
@Cached GetTypeMemberNode getNativeDict,

0 commit comments

Comments
 (0)