Skip to content

Commit 76dfd66

Browse files
committed
Correctly wrap/unwrap 'NotImplemented'.
1 parent 33a96f4 commit 76dfd66

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

graalpython/com.oracle.graal.python.cext/src/capi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static void initialize_globals() {
5252
truffle_assign_managed(&_Py_NoneStruct, jnone);
5353

5454
// NotImplemented
55-
void *jnotimpl = polyglot_as__object(polyglot_get_member(PY_BUILTIN, "NotImplemented"));
55+
void *jnotimpl = polyglot_as__object(to_sulong(polyglot_get_member(PY_BUILTIN, "NotImplemented")));
5656
truffle_assign_managed(&_Py_NotImplementedStruct, jnotimpl);
5757

5858
// True, False

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Object runNativeObject(PythonNativeObject object) {
6464
return object.object;
6565
}
6666

67-
@Specialization(guards = {"!isNativeClass(object)", "!isNativeObject(object)"})
67+
@Specialization(guards = {"!isNativeClass(object)", "!isNativeObject(object)", "!isNoValue(object)"})
6868
Object runNativeObject(PythonAbstractObject object) {
6969
assert object != PNone.NO_VALUE;
7070
return PythonObjectNativeWrapper.wrap(object);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ abstract static class ReadNativeMemberNode extends PBaseNode {
109109
abstract Object execute(Object receiver, Object key);
110110

111111
@Specialization(guards = "eq(OB_BASE, key)")
112-
Object doObBase(PythonObject o, @SuppressWarnings("unused") String key) {
112+
Object doObBase(PythonAbstractObject o, @SuppressWarnings("unused") String key) {
113113
return getToSulongNode().execute(o);
114114
}
115115

@@ -124,12 +124,12 @@ Object doObBase(String o, @SuppressWarnings("unused") String key) {
124124
}
125125

126126
@Specialization(guards = "eq(OB_REFCNT, key)")
127-
int doObRefcnt(@SuppressWarnings("unused") PythonObject o, @SuppressWarnings("unused") String key) {
127+
int doObRefcnt(@SuppressWarnings("unused") PythonAbstractObject o, @SuppressWarnings("unused") String key) {
128128
return 0;
129129
}
130130

131131
@Specialization(guards = "eq(OB_TYPE, key)")
132-
Object doObType(PythonObject object, @SuppressWarnings("unused") String key) {
132+
Object doObType(PythonAbstractObject object, @SuppressWarnings("unused") String key) {
133133
return getToSulongNode().execute(getClass.execute(object));
134134
}
135135

0 commit comments

Comments
 (0)