DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41069>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41069

           Summary: array elements' type not always verified by JustIce
           Product: BCEL
           Version: unspecified
          Platform: Macintosh
        OS/Version: Mac OS X 10.4
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Main
        AssignedTo: bcel-dev@jakarta.apache.org
        ReportedBy: [EMAIL PROTECTED]


The following class is accepted by JustIce (BCEL 5.2), whereas Sun verifier 
(correctly) rejects it:

Compiled from "Test.java"
public class Test extends java.lang.Object{
public Test();
  Code:
   0:   aload_0
   1:   invokespecial   #9; //Method java/lang/Object."<init>":()V
   4:   return

public static void main(java.lang.String[]);
  Code:
   0:   aload_0
   1:   iconst_0
   2:   caload
   3:   return

}

In the "main" method we are trying to read a char from an array of Strings and 
this is of course type-
incorrect.

My take on the solution is that in the 
org.apache.bcel.verifier.structurals.InstConstraintVisitor class, in 
the visitCALOAD method, there are only two checks being made: whether the index 
is of int type, and 
whether there is really an array on the stack.  What is missing is the check, 
whether the array holds 
element of 'char' type.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to