Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 5462 Details for
Bug 39479
NPE in bcel.LazyMethodGen when delegating from one ctor to a second that includes a switch.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch for BCELClassWeaver
patch2.txt (text/plain), 2.19 KB, created by
Andrew Clement
on 2003-07-15 10:14:04 EDT
(
hide
)
Description:
Patch for BCELClassWeaver
Filename:
MIME Type:
Creator:
Andrew Clement
Created:
2003-07-15 10:14:04 EDT
Size:
2.19 KB
patch
obsolete
>Index: BcelClassWeaver.java >=================================================================== >RCS file: /home/technology/org.aspectj/modules/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java,v >retrieving revision 1.13 >diff -u -r1.13 BcelClassWeaver.java >--- BcelClassWeaver.java 2 May 2003 06:28:16 -0000 1.13 >+++ BcelClassWeaver.java 15 Jul 2003 14:03:33 -0000 >@@ -44,6 +44,7 @@ > import org.apache.bcel.generic.PUTSTATIC; > import org.apache.bcel.generic.RET; > import org.apache.bcel.generic.ReturnInstruction; >+import org.apache.bcel.generic.SWITCH; > import org.apache.bcel.generic.Select; > import org.apache.bcel.generic.Type; > import org.aspectj.bridge.IMessage; >@@ -462,7 +463,28 @@ > dest = ret.append(fact.createBranchInstruction(Constants.GOTO, end)); > } > } else if (fresh instanceof BranchInstruction) { >- dest = ret.append((BranchInstruction) fresh); >+ if (fresh instanceof Select) { >+ // Bugzilla #39479 >+ // Need to manually copy Select instructions - if we rely on the the 'fresh' object >+ // created by copy() above, the InstructionHandle array 'targets' inside the Select >+ // object will not have been deep copied, so modifying targets in fresh will modify >+ // the original Select - not what we want ! (It is a bug in BCEL to do with cloning >+ // Select objects). >+ Select freshSelect = (Select)fresh; >+ >+ // Create a new targets array that looks just like the existing one >+ InstructionHandle[] targets = new InstructionHandle[freshSelect.getTargets().length]; >+ for (int i = 0; i < targets.length; i++) { >+ targets[i] = freshSelect.getTargets()[i]; >+ } >+ >+ // Create a new select statement with the new targets array >+ SWITCH switchStatement = new SWITCH(freshSelect.getMatchs(),targets,freshSelect.getTarget()); >+ Select sel = (Select)switchStatement.getInstruction(); >+ dest = ret.append((BranchInstruction)sel); >+ } else { >+ dest = ret.append((BranchInstruction) fresh); >+ } > } else if ( > fresh instanceof LocalVariableInstruction || fresh instanceof RET) { > IndexedInstruction indexed = (IndexedInstruction) fresh;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
aclement
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 39479
: 5462