DO NOT REPLY [Bug 43367] - MethodGen.setMaxLocals() calculates too small max locals, which results in a ClassFormatError when loading the modified class

2007-09-13 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=43367.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43367





--- Additional Comments From [EMAIL PROTECTED]  2007-09-13 03:38 ---
Created an attachment (id=20810)
 -- (http://issues.apache.org/bugzilla/attachment.cgi?id=20810action=view)
Example how to reproduce the issue.

Start the Reproducer with java -cp bcel.jar:. Reproducer - the example
instrument the constructor of it's own class, adds a field, and tries to load
the modified class.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 43391] New: - ARRAYLENGTH incorrectly not StackConsumer

2007-09-13 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=43391.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43391

   Summary: ARRAYLENGTH incorrectly not StackConsumer
   Product: BCEL
   Version: 5.2
  Platform: All
OS/Version: All
Status: NEW
  Keywords: PatchAvailable
  Severity: normal
  Priority: P3
 Component: Main
AssignedTo: bcel-dev@jakarta.apache.org
ReportedBy: [EMAIL PROTECTED]


According to the JVM Instruction Set, ARRAYLENGTH pops a value from the stack
and pushes a value to the stack. In BCEL, it only implements StackProducer, so
it creates an incorrectly high stack height. The Constants class already has the
correct value for it, but since the instruction does not implement StackConsumer
it is never used. The easiest solution is to change
src\java\src\java\org\apache\bcel\generic\ARRAYLENGTH.java to implement
StackConsumer. This will fix the bug.

I didn't attach a patch for this because the change is so tiny.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]