From f023d390771f800d2921f76d51a39754eee4af16 Mon Sep 17 00:00:00 2001 From: edwin Date: Fri, 7 Oct 2005 14:03:52 +0000 Subject: [PATCH] verify that first argument of instance method is of reference type --- src/vm/jit/verify/typecheck.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/vm/jit/verify/typecheck.c b/src/vm/jit/verify/typecheck.c index bf61c59b0..7c1f2686a 100644 --- a/src/vm/jit/verify/typecheck.c +++ b/src/vm/jit/verify/typecheck.c @@ -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) -- 2.25.1