commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Bourg (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (BCEL-124) tableswitch/lookupswitch invalid alignment of 4-byte operands
Date Thu, 24 Apr 2014 09:13:19 GMT

     [ 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)

Mime
View raw message