summaryrefslogtreecommitdiff
path: root/libjava/interpret.cc
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2002-11-26 06:51:14 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2002-11-26 06:51:14 +0000
commit5d698b0def2de7648b47bcf86ec2ea3e7a237f09 (patch)
tree3523ae56e241e44fb26f03de32973be665940818 /libjava/interpret.cc
parent49f8be83999c651efce5f0ffb6327130c26b46e7 (diff)
downloadgcc-5d698b0def2de7648b47bcf86ec2ea3e7a237f09.tar.gz
* verify.cc (type::compatible): Check initialization status
first. * interpret.cc (run) [insn_invokespecial, invokespecial_resolved]: Don't use NULLCHECK. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59494 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/interpret.cc')
-rw-r--r--libjava/interpret.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/libjava/interpret.cc b/libjava/interpret.cc
index d3f919bac13..bc324b13ba9 100644
--- a/libjava/interpret.cc
+++ b/libjava/interpret.cc
@@ -2795,7 +2795,10 @@ _Jv_InterpMethod::run (void *retp, ffi_raw *args)
sp -= rmeth->stack_item_count;
- NULLCHECK (sp[0].o);
+ // We don't use NULLCHECK here because we can't rely on that
+ // working for <init>. So instead we do an explicit test.
+ if (! sp[0].o)
+ throw new java::lang::NullPointerException;
fun = (void (*)()) rmeth->method->ncode;
@@ -2813,7 +2816,10 @@ _Jv_InterpMethod::run (void *retp, ffi_raw *args)
{
rmeth = (_Jv_ResolvedMethod *) AVAL ();
sp -= rmeth->stack_item_count;
- NULLCHECK (sp[0].o);
+ // We don't use NULLCHECK here because we can't rely on that
+ // working for <init>. So instead we do an explicit test.
+ if (! sp[0].o)
+ throw new java::lang::NullPointerException;
fun = (void (*)()) rmeth->method->ncode;
}
goto perform_invoke;