Skip to content

Commit d569b7a

Browse files
committed
Add missing guard to 'AsPythonObjectNode.doNativeObject'.
1 parent 0d0a350 commit d569b7a

File tree

1 file changed

+5
-1
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext

1 file changed

+5
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/CExtNodes.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ PythonAbstractObject doNativeWrapper(PythonObjectNativeWrapper object) {
160160
return object.getPythonObject();
161161
}
162162

163-
@Specialization(guards = "isForeignObject(object)")
163+
@Specialization(guards = {"isForeignObject(object)", "!isNativeWrapper(object)"})
164164
PythonAbstractObject doNativeObject(TruffleObject object) {
165165
return factory().createNativeObjectWrapper(object);
166166
}
@@ -204,6 +204,10 @@ protected boolean isForeignObject(TruffleObject obj) {
204204
return getClassNode.execute(obj) == getCore().getForeignClass();
205205
}
206206

207+
protected boolean isNativeWrapper(Object obj) {
208+
return obj instanceof PythonNativeWrapper;
209+
}
210+
207211
@TruffleBoundary
208212
public static Object doSlowPath(Object object) {
209213
if (object instanceof PythonObjectNativeWrapper) {

0 commit comments

Comments
 (0)