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 final List<CatchBlock> blocks = new ArrayList<CatchBlock>();
|
||||||
|
|
||||||
|
private int nextLocalIndexBeforeInline = -1;
|
||||||
|
|
||||||
public InlineAdapter(MethodVisitor mv, int localsSize) {
|
public InlineAdapter(MethodVisitor mv, int localsSize) {
|
||||||
super(mv);
|
super(mv);
|
||||||
nextLocalIndex = localsSize;
|
nextLocalIndex = localsSize;
|
||||||
@@ -62,6 +64,11 @@ public class InlineAdapter extends InstructionAdapter {
|
|||||||
|
|
||||||
public void setInlining(boolean isInlining) {
|
public void setInlining(boolean isInlining) {
|
||||||
this.isInlining = isInlining;
|
this.isInlining = isInlining;
|
||||||
|
if (isInlining) {
|
||||||
|
nextLocalIndexBeforeInline = nextLocalIndex;
|
||||||
|
} else {
|
||||||
|
nextLocalIndex = nextLocalIndexBeforeInline;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -104,7 +104,6 @@ public class MethodInliner {
|
|||||||
|
|
||||||
final Iterator<ConstructorInvocation> iterator = constructorInvocationList.iterator();
|
final Iterator<ConstructorInvocation> iterator = constructorInvocationList.iterator();
|
||||||
|
|
||||||
//TODO add reset to counter
|
|
||||||
InlineAdapter inliner = new InlineAdapter(resultNode, parameters.totalSize()) {
|
InlineAdapter inliner = new InlineAdapter(resultNode, parameters.totalSize()) {
|
||||||
|
|
||||||
private ConstructorInvocation invocation;
|
private ConstructorInvocation invocation;
|
||||||
|
|||||||
Reference in New Issue
Block a user