Skip to content

Commit 65a6606

Browse files
committed
Fix: use AsPythonObjectNode when loading 'ob_type' of native object.
1 parent 0c611f6 commit 65a6606

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import com.oracle.graal.python.builtins.PythonBuiltinClassType;
5050
import com.oracle.graal.python.builtins.objects.PNone;
5151
import com.oracle.graal.python.builtins.objects.PythonAbstractObject;
52+
import com.oracle.graal.python.builtins.objects.cext.CExtNodes.AsPythonObjectNode;
5253
import com.oracle.graal.python.builtins.objects.cext.CExtNodes.ImportCAPISymbolNode;
5354
import com.oracle.graal.python.builtins.objects.cext.CExtNodes.PCallCapiFunction;
5455
import com.oracle.graal.python.builtins.objects.cext.CExtNodes.ToJavaNode;
@@ -217,7 +218,7 @@ public static PythonAbstractClass getNativeClassCached(PythonAbstractNativeObjec
217218
@Specialization(replaces = {"getNativeClassCached", "getNativeClassCachedIdentity"})
218219
public static PythonAbstractClass getNativeClass(PythonAbstractNativeObject object,
219220
@Exclusive @Cached PCallCapiFunction callGetObTypeNode,
220-
@Exclusive @Cached ToJavaNode toJavaNode) {
221+
@Exclusive @Cached AsPythonObjectNode toJavaNode) {
221222
// do not convert wrap 'object.object' since that is really the native pointer
222223
// object
223224
return (PythonAbstractClass) toJavaNode.execute(callGetObTypeNode.call(FUN_GET_OB_TYPE, object.getPtr()));
@@ -226,7 +227,7 @@ public static PythonAbstractClass getNativeClass(PythonAbstractNativeObject obje
226227
public static PythonAbstractClass getNativeClassUncached(PythonAbstractNativeObject object) {
227228
// do not convert wrap 'object.object' since that is really the native pointer
228229
// object
229-
return getNativeClass(object, PCallCapiFunction.getUncached(), ToJavaNode.getUncached());
230+
return getNativeClass(object, PCallCapiFunction.getUncached(), AsPythonObjectNode.getUncached().getUncached());
230231
}
231232
}
232233

0 commit comments

Comments
 (0)