Skip to content

Commit

Permalink
Only assert valid payload
Browse files Browse the repository at this point in the history
  • Loading branch information
JaroslavTulach committed Dec 30, 2024
1 parent ebe0553 commit 2301f9b
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ public PanicException(Object payload, Node location) {
*/
public PanicException(Object payload, Throwable cause, Node location) {
super(null, cause, UNLIMITED_STACK_TRACE, location);
if (!InteropLibrary.isValidValue(payload)) {
CompilerDirectives.transferToInterpreter();
throw new IllegalArgumentException("Only interop values are supported: " + payload);
}
assert InteropLibrary.isValidValue(payload) : "Only interop values are supported: " + payload;
this.payload = payload;
}

Expand Down

0 comments on commit 2301f9b

Please sign in to comment.