summaryrefslogtreecommitdiff
path: root/libjava/interpret.cc
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2001-02-12 17:30:00 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2001-02-12 17:30:00 +0000
commita6a4df66b06d5563c22185dd1065dc3b1355827c (patch)
tree4c00b61de5e3634c10d50ef6364693ac611dd522 /libjava/interpret.cc
parentdb5c1dabe2a9d80526ce037afdceaa3b27312b3b (diff)
downloadgcc-a6a4df66b06d5563c22185dd1065dc3b1355827c.tar.gz
2001-02-12 Jeff Sturm <jeff.sturm@commerceone.com>
Tom Tromey <tromey@redhat.com> * interpret.cc (continue1): [insn_invokevirtual] Do an explicit null pointer check. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39607 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/interpret.cc')
-rw-r--r--libjava/interpret.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/libjava/interpret.cc b/libjava/interpret.cc
index 0a069ac4e1c..aba1e2f966e 100644
--- a/libjava/interpret.cc
+++ b/libjava/interpret.cc
@@ -1,6 +1,6 @@
// interpret.cc - Code for the interpreter
-/* Copyright (C) 1999, 2000 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -678,7 +678,11 @@ void _Jv_InterpMethod::continue1 (_Jv_InterpMethodInvocation *inv)
rmeth = (_Jv_ResolvePoolEntry (defining_class, index)).rmethod;
sp -= rmeth->stack_item_count;
- NULLCHECK (sp[0].o);
+ // We don't use NULLCHECK here because we can't rely on that
+ // working if the method is final. So instead we do an
+ // explicit test.
+ if (! sp[0].o)
+ throw new java::lang::NullPointerException ();
if (rmeth->vtable_index == -1)
{