Skip to content

Commit ddd19fb

Browse files
committed
Do not catch ThreadDeath from C calls
as seen in build 20139753
1 parent b0f178b commit ddd19fb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,13 @@ static PythonBuiltinObject doOther(@SuppressWarnings("unused") Object value) {
244244
}
245245

246246
public static PException checkThrowableBeforeNative(Throwable t, String where1, Object where2) {
247-
if (t instanceof PException) {
247+
if (t instanceof PException pe) {
248248
// this is ok, and will be handled correctly
249-
throw (PException) t;
249+
throw pe;
250+
}
251+
if (t instanceof ThreadDeath td) {
252+
// ThreadDeath subclasses are used internally by Truffle
253+
throw td;
250254
}
251255
// everything else: log and convert to PException (SystemError)
252256
CompilerDirectives.transferToInterpreter();

0 commit comments

Comments
 (0)