Skip to content

Commit 64fcb77

Browse files
committed
fall into interpreter on stackoverflow
1 parent d39f2bc commit 64fcb77

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ public static PException checkThrowableBeforeNative(Throwable t, String where1,
255255
throw td;
256256
}
257257
if (t instanceof StackOverflowError soe) {
258+
CompilerDirectives.transferToInterpreter();
258259
PythonContext context = PythonContext.get(null);
259260
context.reacquireGilAfterStackOverflow();
260261
PBaseException newException = context.factory().createBaseException(RecursionError, ErrorMessages.MAXIMUM_RECURSION_DEPTH_EXCEEDED, EMPTY_OBJECT_ARRAY);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ public static PException checkThrowableBeforeNative(Throwable t, String where1,
176176
throw td;
177177
}
178178
if (t instanceof StackOverflowError soe) {
179+
CompilerDirectives.transferToInterpreter();
179180
PythonContext context = PythonContext.get(null);
180181
context.reacquireGilAfterStackOverflow();
181182
PBaseException newException = context.factory().createBaseException(RecursionError, ErrorMessages.MAXIMUM_RECURSION_DEPTH_EXCEEDED, EMPTY_OBJECT_ARRAY);

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/exception/TopLevelExceptionHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ public Object execute(VirtualFrame frame) {
148148
}
149149
throw handlePythonException(e);
150150
} catch (StackOverflowError e) {
151+
CompilerDirectives.transferToInterpreter();
151152
PythonContext context = getContext();
152153
context.reacquireGilAfterStackOverflow();
153154
PBaseException newException = context.factory().createBaseException(RecursionError, ErrorMessages.MAXIMUM_RECURSION_DEPTH_EXCEEDED, new Object[]{});

0 commit comments

Comments
 (0)