Skip to content

Commit

Permalink
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/ir/IRClosure.java
Original file line number Diff line number Diff line change
@@ -304,7 +304,7 @@ public IRClosure cloneForInlining(CloneInfo ii) {
IRClosure clonedClosure;
IRScope lexicalParent = ii.getScope();

if (ii instanceof SimpleCloneInfo) {
if (ii instanceof SimpleCloneInfo && !((SimpleCloneInfo)ii).isEnsureBlockCloneMode()) {
clonedClosure = new IRClosure(this, lexicalParent, closureId, getName());
} else {
int id = lexicalParent.getNextClosureId();
Original file line number Diff line number Diff line change
@@ -17,6 +17,10 @@ public SimpleCloneInfo(IRScope scope, boolean isEnsureBlock) {
this.isEnsureBlock = isEnsureBlock;
}

public boolean isEnsureBlockCloneMode() {
return this.isEnsureBlock;
}

public Variable getRenamedVariable(Variable variable) {
Variable renamed = super.getRenamedVariable(variable);

@@ -47,4 +51,4 @@ protected Variable getRenamedVariableSimple(Variable v) {
public void renameLabel(Label l) {
labelRenameMap.put(l, getScope().getNewLabel());
}
}
}

0 comments on commit 1a27cb4

Please sign in to comment.