jakarta-bcel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 43367] New: - MethodGen.setMaxLocals() calculates too small max locals, which results in a ClassFormatError when loading the modified class
Date Wed, 12 Sep 2007 15:21:06 GMT
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

           Summary: MethodGen.setMaxLocals() calculates too small max
                    locals, which results in a ClassFormatError when loading
                    the modified class
           Product: BCEL
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main
        AssignedTo: bcel-dev@jakarta.apache.org
        ReportedBy: erich.hochmuth@dynatrace.com


Revision 574984 (trunk)

When a local variable is added to a method, the max_locals are incremented in
addLocalVariable (set to slot + size of type).
However, when no other transformations are made, and setMaxLocals() is called,
the bytecode is searched for the max variable index, and max_locals set to that
index + size of that entry. The old max_locals which was set by adding the field
is overwritten by this number.

If the LocalVariableTable for that method exists, the Java VM won't load the
class, because the max_locals determined by bcel is smaller than the max locals
determined from the localvariabletable => ClassFormatException.

-- 
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: bcel-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-dev-help@jakarta.apache.org


Mime
View raw message