verify that first argument of instance method is of reference type
authoredwin <none@none>
Fri, 7 Oct 2005 14:03:52 +0000 (14:03 +0000)
committeredwin <none@none>
Fri, 7 Oct 2005 14:03:52 +0000 (14:03 +0000)
src/vm/jit/verify/typecheck.c

index bf61c59b01eda733f61b516fd224993f3e507ea0..7c1f2686a59547d200d4fc22b007f17f1d7ab108 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes: Christian Thalinger
 
-   $Id: typecheck.c 3369 2005-10-06 10:29:43Z edwin $
+   $Id: typecheck.c 3387 2005-10-07 14:03:52Z edwin $
 
 */
 
@@ -1156,6 +1156,13 @@ verify_invocation(verifier_state *state)
                                LOGSTR("class: "); LOGNAME(initclass); LOGNL;
                        }
                }
+               else {
+                       /* non-adress argument. if this is the first argument and we are */
+                       /* invoking an instance method, this is an error.                */
+                       if (i==0 && opcode != ICMD_INVOKESTATIC) {
+                               TYPECHECK_VERIFYERROR_bool("Parameter type mismatch for 'this' argument");
+                       }
+               }
                LOG("ok");
 
                if (i)