You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bcel-dev@jakarta.apache.org by bu...@apache.org on 2009/11/25 12:25:51 UTC

DO NOT REPLY [Bug 48280] New: FieldInstruction.getFieldSize() doesn't decode Type.getTypeSize() output

https://issues.apache.org/bugzilla/show_bug.cgi?id=48280

           Summary: FieldInstruction.getFieldSize() doesn't decode
                    Type.getTypeSize() output
           Product: BCEL
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main
        AssignedTo: bcel-dev@jakarta.apache.org
        ReportedBy: enrico.gueli@polito.it


Created an attachment (id=24609)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24609)
a patch for this bug

The method getTypeSize(String) in the Type class returns two outputs encoded in
one integer: the lowest two bits contain the field size (0, 1 or 2), the
remaining ones the no. of consumed characters in the signature. Type provides
two private static methods, size() and consumed(), to split these values apart.

The method getFieldSize(ConstantPoolGen) in the FieldInstrucion class uses
Type.getTypeSize, unaware that the output is encoded. Therefore, the returned
size is different than expected. This causes, among other things, a bigger or
smaller max stack depth value for generated methods that leads to unused stack
memory or a "java.lang.VerifyError: stack size too large" exception,
respectively.

A fix can be made by making the above-mentioned static methods package-visible
and modifying getFieldSize() to use them.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 48280] FieldInstruction.getFieldSize() doesn't decode Type.getTypeSize() output

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48280

Torsten Curdt <tc...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #1 from Torsten Curdt <tc...@apache.org> 2010-01-10 12:33:00 UTC ---
Thx! Applied.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-dev-help@jakarta.apache.org