Navigation Menu

Skip to content

Commit

Permalink
Preserve update of currDynScope in interpreter loop.
Browse files Browse the repository at this point in the history
* When explicit call protocol instructions are present, currDynScope
  gets modified in the interpreter loop as part of push_binding
  instruction execution. This update should be preserved.
  • Loading branch information
subbuss committed Oct 20, 2014
1 parent ee1d3d2 commit ac42880
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/src/main/java/org/jruby/ir/interpreter/Interpreter.java
Expand Up @@ -570,7 +570,11 @@ private static IRubyObject interpret(ThreadContext context, IRubyObject self,
break;
case BOOK_KEEPING_OP:
if (operation == Operation.PUSH_BINDING) {
context.pushScope(interpreterContext.newDynamicScope(context));
// IMPORTANT: Preserve this update of currDynScope.
// This affects execution of all instructions in this scope
// which will now use the updated value of currDynScope.
currDynScope = interpreterContext.newDynamicScope(context);
context.pushScope(currDynScope);
} else {
processBookKeepingOp(context, instr, operation, name, args, self, block, implClass, visibility);
}
Expand Down

0 comments on commit ac42880

Please sign in to comment.