Skip to content

Commit 1afa6a6

Browse files
committed
don't compile slow-path exception branches
1 parent 8015eaf commit 1afa6a6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/PythonCextBuiltins.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,8 +843,10 @@ Object doIt(VirtualFrame frame,
843843
try {
844844
return fromNative(asPythonObjectNode.execute(checkResultNode.execute(name, lib.execute(fun, arguments))));
845845
} catch (UnsupportedTypeException | UnsupportedMessageException e) {
846+
CompilerDirectives.transferToInterpreter();
846847
throw raiseNode.raise(PythonBuiltinClassType.TypeError, "Calling native function %s failed: %m", name, e);
847848
} catch (ArityException e) {
849+
CompilerDirectives.transferToInterpreter();
848850
throw raiseNode.raise(PythonBuiltinClassType.TypeError, "Calling native function %s expected %d arguments but got %d.", name, e.getExpectedArity(), e.getActualArity());
849851
} finally {
850852
// special case after calling a C function: transfer caught exception back to frame

0 commit comments

Comments
 (0)