added case for verifying unresolved arrayinstanceof
authoredwin <none@none>
Thu, 6 Oct 2005 00:11:09 +0000 (00:11 +0000)
committeredwin <none@none>
Thu, 6 Oct 2005 00:11:09 +0000 (00:11 +0000)
src/vm/jit/verify/typecheck.c

index f51e9a66ff674ae6a9acd4dde9d069f8af41d507..47dd87e898d6ee2c8e3eb4b2e963590f99a11523 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes: Christian Thalinger
 
-   $Id: typecheck.c 3362 2005-10-05 23:03:40Z edwin $
+   $Id: typecheck.c 3363 2005-10-06 00:11:09Z edwin $
 
 */
 
@@ -1436,6 +1436,16 @@ verify_builtin(verifier_state *state)
                if (!vft->arraydesc)
                        TYPECHECK_VERIFYERROR_bool("internal error: builtin_arrayinstanceof with non-array class");
        }
+       else if (ISBUILTIN(PATCHER_builtin_arrayinstanceof)) {
+               constant_classref *cr;
+               
+               TYPECHECK_ADR(state->curstack->prev);
+               if (state->iptr[-1].opc != ICMD_ACONST)
+                       TYPECHECK_VERIFYERROR_bool("illegal instruction: builtin_arrayinstanceof without class");
+               cr = (constant_classref *) state->iptr[-1].val.a;
+               if (cr->name->text[0] != '[')
+                       TYPECHECK_VERIFYERROR_bool("internal error: builtin_arrayinstanceof with non-array class refernce");
+       }
        else {
                return verify_generic_builtin(state);
        }