]> source.dussan.org Git - aspectj.git/commitdiff
Fix 470658: Corrupted Local Variable Table V1_8_8
authorAndy Clement <aclement@pivotal.io>
Thu, 7 Jan 2016 20:56:05 +0000 (12:56 -0800)
committerAndy Clement <aclement@pivotal.io>
Thu, 7 Jan 2016 20:56:05 +0000 (12:56 -0800)
weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java

index 97e73832b2b81ca8869593adfe5e7cbc479475c8..869ed58195601e0f2cddf3d3c1a33b50ec68d887 100644 (file)
@@ -1324,6 +1324,16 @@ public final class LazyMethodGen implements Traceable {
                                }
                        }
                }
+               if (!this.enclosingClass.getWorld().generateNewLvts) {
+                       // Here the generateNewLvts option is used to control "Do not damage unusually positioned local
+                       // variables that represent method parameters". Strictly speaking local variables that represent
+                       // method parameters effectively have a bytecode range from 0..end_of_method - however some
+                       // tools generate bytecode that specifies a compressed range. The code below would normally
+                       // extend the parameter local variables to cover the full method but by setting paramSlots to -1
+                       // here we cause the code below to avoid modifying any local vars that represent method
+                       // parameters.
+                       paramSlots = -1;
+               }
 
                Map<InstructionHandle, Set<Integer>> duplicatedLocalMap = new HashMap<InstructionHandle, Set<Integer>>();
                for (LocalVariableTag tag : localVariables.keySet()) {