Skip to content

Commit 9ad3bbb

Browse files
committed
Transfer explicitly to interpreter before raising exception when thread status is unknown
1 parent c0494b0 commit 9ad3bbb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/org/truffleruby/core/thread/ThreadNodes.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,8 @@ Object threadSetStatus(RubyThread thread, RubySymbol status) {
603603
} else if (status == coreSymbols().DEAD) {
604604
thread.status = ThreadStatus.DEAD;
605605
} else {
606-
throw CompilerDirectives.shouldNotReachHere(status.toString());
606+
CompilerDirectives.transferToInterpreterAndInvalidate();
607+
throw CompilerDirectives.shouldNotReachHere("Unknown thread status: " + status.getString());
607608
}
608609

609610
return threadStatusToRubySymbol(previous, coreSymbols());
@@ -1094,7 +1095,8 @@ private static RubySymbol threadStatusToRubySymbol(ThreadStatus status, CoreSymb
10941095
} else if (status == ThreadStatus.DEAD) {
10951096
symbol = coreSymbols.DEAD;
10961097
} else {
1097-
throw CompilerDirectives.shouldNotReachHere(status.toString());
1098+
CompilerDirectives.transferToInterpreterAndInvalidate();
1099+
throw CompilerDirectives.shouldNotReachHere("Unknown thread status: " + status);
10981100
}
10991101

11001102
return symbol;

0 commit comments

Comments
 (0)