Menu

#62 ArrayStoreInstruction type check error

open
nobody
5
2009-04-29
2009-04-29
Jim Cluase
No

It looks like ArrayStoreInstructions type checking is incorrect. The following code causes JPF to throw an ArrayStoreException from ArrayStoreInstruction.java:72.

Object[][] o = new Object[][] { new Class[0], new String[0] };

I looks like the type checking assumes that the array will only be one dimension so it figures the component type is [Ljava.lang.Object (instead of Ljava.lang.Object) which is not a supertype of Ljava/lang/Class.

My quick fix is to add this code:

while(arrayElementCi.isArray()) arrayElementCi = arrayElementCi.getComponentClassInfo();

after line 66 in ArrayStoreInstruction.java

Discussion


Log in to post a comment.

MongoDB Logo MongoDB