|
44 | 44 | import static com.oracle.graal.python.builtins.PythonBuiltinClassType.SystemError;
|
45 | 45 | import static com.oracle.graal.python.nodes.SpecialMethodNames.__GETITEM__;
|
46 | 46 | import static com.oracle.graal.python.runtime.exception.PythonErrorType.OverflowError;
|
47 |
| -import static com.oracle.graal.python.runtime.exception.PythonErrorType.TypeError; |
48 | 47 |
|
49 | 48 | import java.math.BigInteger;
|
50 | 49 | import java.nio.ByteBuffer;
|
|
82 | 81 | import com.oracle.graal.python.builtins.objects.cext.CExtNodesFactory.MayRaiseTernaryNodeGen;
|
83 | 82 | import com.oracle.graal.python.builtins.objects.cext.CExtNodesFactory.MayRaiseUnaryNodeGen;
|
84 | 83 | import com.oracle.graal.python.builtins.objects.cext.HandleCache;
|
85 |
| -import com.oracle.graal.python.builtins.objects.cext.NativeWrappers.PrimitiveNativeWrapper; |
86 | 84 | import com.oracle.graal.python.builtins.objects.cext.NativeMemberNames;
|
| 85 | +import com.oracle.graal.python.builtins.objects.cext.NativeWrappers.PrimitiveNativeWrapper; |
87 | 86 | import com.oracle.graal.python.builtins.objects.cext.NativeWrappers.PySequenceArrayWrapper;
|
88 | 87 | import com.oracle.graal.python.builtins.objects.cext.NativeWrappers.PythonClassInitNativeWrapper;
|
89 | 88 | import com.oracle.graal.python.builtins.objects.cext.NativeWrappers.PythonClassNativeWrapper;
|
@@ -2005,7 +2004,7 @@ private static BigInteger convertToBigInteger(long n) {
|
2005 | 2004 | @Specialization
|
2006 | 2005 | Object doPointer(PythonNativeObject n, @SuppressWarnings("unused") int signed,
|
2007 | 2006 | @Cached("create()") CExtNodes.ToSulongNode toSulongNode) {
|
2008 |
| - return toSulongNode.execute(factory().createNativeVoidPtr((TruffleObject) n.object)); |
| 2007 | + return toSulongNode.execute(factory().createNativeVoidPtr(n.object)); |
2009 | 2008 | }
|
2010 | 2009 | }
|
2011 | 2010 |
|
@@ -2145,10 +2144,7 @@ abstract static class PyBytes_FromStringAndSize extends NativeBuiltin {
|
2145 | 2144 |
|
2146 | 2145 | @Specialization
|
2147 | 2146 | PBytes doGeneric(PythonNativeObject object) {
|
2148 |
| - if (object.object instanceof TruffleObject) { |
2149 |
| - return factory().createBytes(getByteArray((TruffleObject) object.object)); |
2150 |
| - } |
2151 |
| - throw raise(TypeError, "invalid pointer: %s", object.object); |
| 2147 | + return factory().createBytes(getByteArray(object.object)); |
2152 | 2148 | }
|
2153 | 2149 | }
|
2154 | 2150 |
|
|
0 commit comments