public Variable getRenamedVariable(Variable variable) { Variable renamed = super.getRenamedVariable(variable); // WrappedIRClosure operands in ensure blocks processing will cloneForInlining and inherit the top-scopes // SimpleCloneInfo instance which will already contain a depth 0 version of this "local" variable. We are // in a closure in early stages of cloning it around anywhere it should be for ensure (we copy same ensure // bodies to all possible exit paths) We know closures containing lvars will have the wrong depth. if (variable instanceof LocalVariable && !((LocalVariable) variable).isSameDepth((LocalVariable) renamed)) { return ((LocalVariable) renamed).cloneForDepth(((LocalVariable) variable).getScopeDepth()); } return renamed; }
public Variable getRenamedVariable(Variable variable) { Variable renamed = super.getRenamedVariable(variable); // WrappedIRClosure operands in ensure blocks processing will cloneForInlining and inherit the top-scopes // SimpleCloneInfo instance which will already contain a depth 0 version of this "local" variable. We are // in a closure in early stages of cloning it around anywhere it should be for ensure (we copy same ensure // bodies to all possible exit paths) We know closures containing lvars will have the wrong depth. if (variable instanceof LocalVariable && !((LocalVariable) variable).isSameDepth((LocalVariable) renamed)) { return ((LocalVariable) renamed).cloneForDepth(((LocalVariable) variable).getScopeDepth()); } return renamed; }