Skip to content

Commit

Permalink
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/ir/IRBuilder.java
Original file line number Diff line number Diff line change
@@ -2228,7 +2228,7 @@ public Operand buildEnsureInternal(Node ensureBodyNode, Node ensurerNode) {

ensureBodyBuildStack.push(ebi);
// Restore $! if we the exception was rescued
if (ensureBodyNode != null) {
if (ensureBodyNode != null && ensureBodyNode instanceof RescueNode) {
addInstr(new PutGlobalVarInstr("$!", savedGlobalException));
ebi.savedGlobalException = savedGlobalException;
}

0 comments on commit b35f9d3

Please sign in to comment.