You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Emmanuel Bourg (JIRA)" <ji...@apache.org> on 2014/04/24 11:13:19 UTC

[jira] [Updated] (BCEL-124) tableswitch/lookupswitch invalid alignment of 4-byte operands

     [ https://issues.apache.org/jira/browse/BCEL-124?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Bourg updated BCEL-124:
--------------------------------

         Priority: Major
    Fix Version/s: 6.0
         Priority:   (was: P2)
         Severity:   (was: normal)

> tableswitch/lookupswitch invalid alignment of 4-byte operands
> -------------------------------------------------------------
>
>                 Key: BCEL-124
>                 URL: https://issues.apache.org/jira/browse/BCEL-124
>             Project: Commons BCEL
>          Issue Type: Bug
>          Components: Main
>    Affects Versions: 5.2
>         Environment: Operating System: All
> Platform: All
>            Reporter: Timothy Alper
>            Assignee: Apache Commons Developers
>             Fix For: 6.0
>
>         Attachments: SetPositionsBug.java, bug45230.patch
>
>
> It is possible, with BCEL, to generate invalid alignment of the 4-byte operands of the Select instructions. The problem is caused by the interaction of InstructionList.setPositions, the updatePosition methods of GOTO and JSR, and Select.updatePosition.
> In particular, the updatePosition methods of GOTO and JSR will always return the difference between the wide instruction length and the normal instruction length. Since this value ends up being added into the additional_bytes variable in InstructionList.setPositions and then eventually contributes to the value passed into Select.updatePosition as the offset, its incorrect value causes the padding field to be set incorrectly.
> It appears that in order to behave properly, the updatePosition method should return only the number of bytes of length that the instruction changed during this call to updatePosition.
> I am attaching a small example application that displays the bug.
> I will also be attaching a patch.



--
This message was sent by Atlassian JIRA
(v6.2#6252)