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/09/25 11:52:48 UTC
DO NOT REPLY [Bug 47902] New: ExecutionVisitor doesn't support Class
constant type for LDC and LDC_W
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
DO NOT REPLY [Bug 47902] ExecutionVisitor doesn't support Class
constant type for LDC and LDC_W
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47902
--- Comment #1 from Enrico Gueli <en...@polito.it> 2009-09-25 03:27:19 PDT ---
(In reply to comment #0)
> Moreover, it would be desired to throw an exception when an unknown constant
> type is encountered, rather than doing nothing at all.
I've just read the Javadoc of ExecutionVisitor, that states that it doesn't
check for correct types on the OperandStack. Therefore I remove the checks and
just add the class literal constant. Sorry for the inconvenience.
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
DO NOT REPLY [Bug 47902] ExecutionVisitor doesn't support Class
constant type for LDC and LDC_W
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47902
--- Comment #2 from Enrico Gueli <en...@polito.it> 2009-09-25 03:28:45 PDT ---
Created an attachment (id=24310)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=24310)
ExecutionVisitor patch (updated)
--
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 47902] ExecutionVisitor doesn't support Class
constant type for LDC and LDC_W
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47902
Enrico Gueli <en...@polito.it> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #24309|application/octet-stream |text/plain
mime type| |
Attachment #24309|0 |1
is patch| |
Attachment #24309|0 |1
is obsolete| |
--
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 47902] ExecutionVisitor doesn't support Class
constant type for LDC and LDC_W
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47902
Torsten Curdt <tc...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #3 from Torsten Curdt <tc...@apache.org> 2010-01-10 12:18:16 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