Bug 43194 - java.lang.VerifyError in generated code
Summary: java.lang.VerifyError in generated code
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.1.1   Edit
Hardware: PC Windows XP
: P1 critical (vote)
Target Milestone: 1.1.1   Edit
Assignee: Jim Hugunin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-16 23:21 EDT by Macneil Shonle CLA
Modified: 2003-09-18 14:45 EDT (History)
0 users

See Also:


Attachments
9 source files, plus a Makefile for cygwin (11.25 KB, application/octet-stream)
2003-09-16 23:23 EDT, Macneil Shonle CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Macneil Shonle CLA 2003-09-16 23:21:32 EDT
See the attached file VerifyBug.jar for the source files. You won't need 
anything else to compiler and reproduce this bug:

~/bug> ls
AbstractCaching.java   TreeNode.java         VerifyBug.jar
ContainerCaching.java  TreeNodeFolding.java  WorkspaceGroup.java
ContainerLoader.java   TreePanel.java        WorkspaceNode.java
Makefile               TreeWorkspace.java
~/bug> gmake   
/cygdrive/c/aspectj1.1.1/bin/ajc -classpath "C:\aspectj1.1.1
\lib\aspectjrt.jar" -version
AspectJ Compiler 1.1.1

/cygdrive/c/aspectj1.1.1/bin/ajc -classpath "C:\aspectj1.1.1\lib\aspectjrt.jar" 
*.java
java -classpath "C:\aspectj1.1.1\lib\aspectjrt.jar;." TreeNode
java.lang.VerifyError: (class: TreeNode, method: doShowAction signature: ()V) 
Unable to pop operand off an empty stack
Exception in thread "main" make: *** [all] Error 1
Comment 1 Macneil Shonle CLA 2003-09-16 23:23:30 EDT
Created attachment 6124 [details]
9 source files, plus a Makefile for cygwin

The makefile isn't necessary, you just need to do a "ajc *.java" with the files
unjarred in a new directory. Then, run java as in the report.
Comment 2 Jim Hugunin CLA 2003-09-18 14:45:22 EDT
Erik and I pair fixed this in the tree.  The bug was caused by
ReferencePointcut.concretize mutating state rather than behaving
properly functionally.

After removing the layers of after advice and cflow entry/exits, the
minimal test case is below.  The multiple levels of indirection, as
well as the concretization with a typename in the first advice followed
by concretization with a parameter name in the second are all required
to cause the bug.

class C {    
    public void m1() {}
    public void m2() {}
}

aspect A {    
    pointcut exec1(C c): this(c) && execution(void m1());
    pointcut execs(C c): exec1(c); 
    
    before (): execs(*) {}
    before (C c):  execs(c) {}
}