Skip to content

Commit

Permalink
Fix #2776: Fix instr ordering in IR Builder
Browse files Browse the repository at this point in the history
* This only affected the interpreter run that relies on the
  exception-region marker instructions to determine rescue
  targets.

* The instruction ordering (old and new) doesn't affect CFG
  construction and how rescue targets are set up since the
  marker instructions are removed once the CFG is constructed.

  So, this bug only affected the default interpreter run.
  • Loading branch information
subbuss committed Mar 29, 2015
1 parent 4ff9bd3 commit dbffda3
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
Expand Up @@ -1335,8 +1335,8 @@ private Operand protectCodeWithRescue(CodeBlock protectedCode, CodeBlock rescueB
addInstr(new ExceptionRegionStartMarkerInstr(rescueLabel));
Object v1 = protectedCode.run(); // YIELD: Run the protected code block
addInstr(new CopyInstr(rv, (Operand)v1));
addInstr(new JumpInstr(rEndLabel));
addInstr(new ExceptionRegionEndMarkerInstr());
addInstr(new JumpInstr(rEndLabel));

// SSS FIXME: Create an 'Exception' operand type to eliminate the constant lookup below
// We could preload a set of constant objects that are preloaded at boot time and use them
Expand Down

0 comments on commit dbffda3

Please sign in to comment.