Skip to content

Commit a4d476e

Browse files
committed
Exclude paths from compilation that shouldn't be reached
1 parent 895d76b commit a4d476e

File tree

1 file changed

+4
-4
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/transitions

1 file changed

+4
-4
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/transitions/CApiTransitions.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,9 +1270,9 @@ static PythonNativeWrapper doGeneric(Node inliningTarget, long pointer,
12701270
@Cached InlinedExactClassProfile profile,
12711271
@Cached UpdateStrongRefNode updateRefNode) {
12721272
if (HandlePointerConverter.pointsToPyIntHandle(pointer)) {
1273-
throw new RuntimeException("ResolveHandleNode int");
1273+
throw CompilerDirectives.shouldNotReachHere("ResolveHandleNode int");
12741274
} else if (HandlePointerConverter.pointsToPyFloatHandle(pointer)) {
1275-
throw new RuntimeException("ResolveHandleNode float");
1275+
throw CompilerDirectives.shouldNotReachHere("ResolveHandleNode float");
12761276
}
12771277
HandleContext nativeContext = PythonContext.get(inliningTarget).nativeContext;
12781278
int idx = readI32Node.read(HandlePointerConverter.pointerToStub(pointer), CFields.GraalPyObject__handle_table_index);
@@ -1986,9 +1986,9 @@ static PythonNativeWrapper doGeneric(Node inliningTarget, long pointer, boolean
19861986
assert pythonContext.ownsGil();
19871987
if (isHandleSpaceProfile.profile(inliningTarget, HandlePointerConverter.pointsToPyHandleSpace(pointer))) {
19881988
if (HandlePointerConverter.pointsToPyIntHandle(pointer)) {
1989-
throw new RuntimeException("not implemented NativePtrToPythonWrapperNode int");
1989+
throw CompilerDirectives.shouldNotReachHere("not implemented NativePtrToPythonWrapperNode int");
19901990
} else if (HandlePointerConverter.pointsToPyFloatHandle(pointer)) {
1991-
throw new RuntimeException("not implemented NativePtrToPythonWrapperNode float");
1991+
throw CompilerDirectives.shouldNotReachHere("not implemented NativePtrToPythonWrapperNode float");
19921992
}
19931993
int idx = readI32Node.read(HandlePointerConverter.pointerToStub(pointer), CFields.GraalPyObject__handle_table_index);
19941994
PythonObjectReference reference = nativeStubLookupGet(nativeContext, pointer, idx);

0 commit comments

Comments
 (0)