Skip to content

Commit 6c9994e

Browse files
committed
Assert that the RaiseException corresponds to the correct Ruby exception
1 parent 3a0b82f commit 6c9994e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/java/org/truffleruby/core/VMPrimitiveNodes.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ public DynamicObject vmRaiseException(DynamicObject exception, boolean internal,
221221
if (reRaiseProfile.profile(backtrace != null && backtrace.getRaiseException() != null)) {
222222
// We need to rethrow the existing RaiseException, otherwise we would lose the
223223
// TruffleStackTrace stored in it.
224+
assert backtrace.getRaiseException().getException() == exception;
224225
throw backtrace.getRaiseException();
225226
} else {
226227
throw new RaiseException(getContext(), exception, internal);

0 commit comments

Comments
 (0)