]> source.dussan.org Git - aspectj.git/commitdiff
avoid NPE (125657)
authoraclement <aclement>
Mon, 30 Jan 2006 10:24:49 +0000 (10:24 +0000)
committeraclement <aclement>
Mon, 30 Jan 2006 10:24:49 +0000 (10:24 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelShadow.java

index 6d04fcd00723fbd9fd5af514dbe9d89e77b94087..fcad1b42cdca40566e5873b667a73b8bc4a9c6ef 100644 (file)
@@ -1357,7 +1357,7 @@ public class BcelShadow extends Shadow {
                LoadInstruction li = (LoadInstruction)searchPtr.getInstruction();
                li.getIndex();
                LocalVariableTag lvt = LazyMethodGen.getLocalVariableTag(searchPtr,li.getIndex());
-               return lvt.getType();
+               if (lvt!=null)  return lvt.getType();
             }
             // A field access instruction may tell us the real type of what the clone() call is on
             if (searchPtr.getInstruction() instanceof FieldInstruction) {
@@ -1381,7 +1381,7 @@ public class BcelShadow extends Shadow {
                return BcelWorld.fromBcel(new ArrayType(Type.OBJECT,ana.getDimensions()));
             }
             throw new BCException("Can't determine real target of clone() when processing instruction "+
-              searchPtr.getInstruction());
+              searchPtr.getInstruction()+".  Perhaps avoid selecting clone with your pointcut?");
        }
        return tx;
     }