Properly index new variables after method inline

This commit is contained in:
Mikhael Bogdanov
2014-02-12 11:58:35 +04:00
parent 55e03dd8b3
commit 5740d99233
2 changed files with 7 additions and 1 deletions
@@ -32,6 +32,8 @@ public class InlineAdapter extends InstructionAdapter {
private final List<CatchBlock> blocks = new ArrayList<CatchBlock>();
private int nextLocalIndexBeforeInline = -1;
public InlineAdapter(MethodVisitor mv, int localsSize) {
super(mv);
nextLocalIndex = localsSize;
@@ -62,6 +64,11 @@ public class InlineAdapter extends InstructionAdapter {
public void setInlining(boolean isInlining) {
this.isInlining = isInlining;
if (isInlining) {
nextLocalIndexBeforeInline = nextLocalIndex;
} else {
nextLocalIndex = nextLocalIndexBeforeInline;
}
}
@Override
@@ -104,7 +104,6 @@ public class MethodInliner {
final Iterator<ConstructorInvocation> iterator = constructorInvocationList.iterator();
//TODO add reset to counter
InlineAdapter inliner = new InlineAdapter(resultNode, parameters.totalSize()) {
private ConstructorInvocation invocation;