diff options
author | aclement <aclement> | 2011-06-07 16:46:19 +0000 |
---|---|---|
committer | aclement <aclement> | 2011-06-07 16:46:19 +0000 |
commit | 95e70d2a23b64e7773d8edf909b1365c19752aa3 (patch) | |
tree | 8c773ca7180dac2c786cdb374cfcd818f56799b2 /weaver | |
parent | 5b4fa2296be8a35ca767088f754f79e5fc791307 (diff) | |
download | aspectj-95e70d2a23b64e7773d8edf909b1365c19752aa3.tar.gz aspectj-95e70d2a23b64e7773d8edf909b1365c19752aa3.zip |
348488: guard and debug
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java b/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java index 4e9495799..1a62b081a 100644 --- a/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java +++ b/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java @@ -1757,10 +1757,16 @@ public class AtAjAttributes { LocalVariable[] lvt = lt.getLocalVariableTable(); for (int j = 0; j < lvt.length; j++) { LocalVariable localVariable = lvt[j]; - if (localVariable.getStartPC() == 0) { - if (localVariable.getIndex() >= startAtStackIndex) { - arguments.add(new MethodArgument(localVariable.getName(), localVariable.getIndex())); + if (localVariable != null) { // pr348488 + if (localVariable.getStartPC() == 0) { + if (localVariable.getIndex() >= startAtStackIndex) { + arguments.add(new MethodArgument(localVariable.getName(), localVariable.getIndex())); + } } + } else { + String typename = (methodStruct.enclosingType != null ? methodStruct.enclosingType.getName() : ""); + System.err.println("AspectJ: 348488 debug: unusual local variable table for method " + typename + "." + + method.getName()); } } if (arguments.size() == 0) { @@ -1771,12 +1777,14 @@ public class AtAjAttributes { // LocalVariable(start_pc = 6, length = 40, index = 2:int __cobertura__line__number__) // LocalVariable(start_pc = 6, length = 40, index = 3:int __cobertura__branch__number__) LocalVariable localVariable = lvt[0]; - if (localVariable.getStartPC() != 0) { - // looks suspicious so let's use this information - for (int j = 0; j < lvt.length && arguments.size() < method.getArgumentTypes().length; j++) { - localVariable = lvt[j]; - if (localVariable.getIndex() >= startAtStackIndex) { - arguments.add(new MethodArgument(localVariable.getName(), localVariable.getIndex())); + if (localVariable != null) { // pr348488 + if (localVariable.getStartPC() != 0) { + // looks suspicious so let's use this information + for (int j = 0; j < lvt.length && arguments.size() < method.getArgumentTypes().length; j++) { + localVariable = lvt[j]; + if (localVariable.getIndex() >= startAtStackIndex) { + arguments.add(new MethodArgument(localVariable.getName(), localVariable.getIndex())); + } } } } |