From: Jeff Sturm Date: Mon, 12 Feb 2001 17:30:00 +0000 (+0000) Subject: interpret.cc (continue1): [insn_invokevirtual] Do an explicit null pointer check. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c6b33a47ea7d36d3e9eb4de227778332b179704d;p=gcc.git interpret.cc (continue1): [insn_invokevirtual] Do an explicit null pointer check. 2001-02-12 Jeff Sturm Tom Tromey * interpret.cc (continue1): [insn_invokevirtual] Do an explicit null pointer check. Co-Authored-By: Tom Tromey From-SVN: r39607 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 93a23bce13d..cfe7f4ab5ee 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2001-02-12 Jeff Sturm + Tom Tromey + + * interpret.cc (continue1): [insn_invokevirtual] Do an explicit + null pointer check. + 2001-02-09 Tom Tromey * java/util/Timer.java: New version from Classpath. 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) {