Properly index new variables after method inline
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user