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 47902] New: ExecutionVisitor doesn't support Class constant type for LDC and LDC_W
Date Fri, 25 Sep 2009 09:52:48 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=47902

           Summary: ExecutionVisitor doesn't support Class constant type
                    for LDC and LDC_W
           Product: BCEL
           Version: 5.2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main
        AssignedTo: bcel-dev@jakarta.apache.org
        ReportedBy: enrico.gueli@polito.it


Created an attachment (id=24309)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24309)
ExecutionVisitor patch

Methods visitLDC() and visitLDC_W() push no values in the stack frame when the
constant type is a class literal, as can happen with Java 1.5 bytecode. This
leads to a false stack underflow exception happening to a subsequent
instruction:

java.lang.ArrayIndexOutOfBoundsException: -1
    at java.util.ArrayList.remove(ArrayList.java:390)
    at
org.apache.bcel.verifier.structurals.OperandStack.pop(OperandStack.java:135)
    at
org.apache.bcel.verifier.structurals.ExecutionVisitor.visitPUTFIELD(ExecutionVisitor.java:1059)
    at org.apache.bcel.generic.PUTFIELD.accept(PUTFIELD.java:78)


Moreover, it would be desired to throw an exception when an unknown constant
type is encountered, rather than doing nothing at all. 

This bug arises while running JiST/SWANS, a network simulator that relies on
rewriting Java bytecode to implement simulation time. To be more specific, it
arises when running the example UDP test application, launching
jist.runtime.Main with arguments "jist.swans.Main driver.udp".

I've attached a possible patch against its HEAD revision (411573).

Enrico

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


Mime
View raw message