From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15898 invoked by alias); 24 Aug 2002 07:26:04 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 15868 invoked by uid 71); 24 Aug 2002 07:26:03 -0000 Resent-Date: 24 Aug 2002 07:26:03 -0000 Resent-Message-ID: <20020824072603.15867.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, java-prs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, jmr@ugcs.caltech.edu Received: (qmail 10232 invoked from network); 24 Aug 2002 07:19:26 -0000 Received: from unknown (HELO smtp.internal.avlsi.com) (65.119.15.68) by sources.redhat.com with SMTP; 24 Aug 2002 07:19:26 -0000 Received: from churchill.internal.avlsi.com (churchill.internal.avlsi.com [10.0.0.7]) by smtp.internal.avlsi.com (Postfix) with ESMTP id ADEF617744C for ; Sat, 24 Aug 2002 00:19:25 -0700 (PDT) Received: (from jmr@localhost) by churchill.internal.avlsi.com (8.11.6/8.11.2) id g7O7JP217953; Sat, 24 Aug 2002 00:19:25 -0700 Message-Id: <200208240719.g7O7JP217953@churchill.internal.avlsi.com> Date: Sat, 24 Aug 2002 05:26:00 -0000 From: jmr@ugcs.caltech.edu To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: 3.113 Subject: libgcj/7709: NullPointerException in _Jv_ResolvePoolEntry X-SW-Source: 2002-08/txt/msg00520.txt.bz2 List-Id: >Number: 7709 >Category: libgcj >Synopsis: NullPointerException in _Jv_ResolvePoolEntry >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Sat Aug 24 00:26:02 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Jesse Rosenstock >Release: 3.3 20020820 (experimental) >Organization: >Environment: System: Linux churchill 2.4.3-12 #1 Fri Jun 8 15:05:56 EDT 2001 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: ../gcc/configure --prefix=/home/user/jmr/app/gcc --enable-langs=c++,java --enable-shared --enable-threads=posix --with-as=/home/user/jmr/app/binutils/bin/as --with-ld=/home/user/jmr/app/binutils/bin/ld >Description: In _Jv_ResolvePoolEntry, if no method is found in the JV_CONSTANT_Methodref/JV_CONSTANT_InterfaceMethodref case, _Jv_DetermineVTableIndex may be called with found_class == NULL, causing a NullPointerException when _Jv_DetermineVTableIndex calls getSuperclass(). >How-To-Repeat: I haven't reduced it to a small test case yet, but it is clear that some error other than NullPointerException should be reported. >Fix: I'm not sure about this, but it does get rid of the NullPointerException, and since the_method is not modified by the code I moved, perhaps the author intended the the_method == 0 check to go first. Index: resolve.cc =================================================================== RCS file: /cvsroot/gcc/gcc/libjava/resolve.cc,v retrieving revision 1.29 diff -c -r1.29 resolve.cc *** resolve.cc 20 Jun 2002 15:10:49 -0000 1.29 --- resolve.cc 24 Aug 2002 06:07:08 -0000 *************** *** 300,315 **** // with either loader should produce the same result, // i.e., exactly the same jclass object. JVMS 5.4.3.3 - if (pool->tags[index] == JV_CONSTANT_InterfaceMethodref) - vtable_index = -1; - else - vtable_index = _Jv_DetermineVTableIndex - (found_class, method_name, method_signature); - - if (vtable_index == METHOD_NOT_THERE) - throw_incompatible_class_change_error - (JvNewStringLatin1 ("method not found")); - if (the_method == 0) { jstring msg = JvNewStringLatin1 ("method "); --- 300,305 ---- *************** *** 320,325 **** --- 310,325 ---- throw new java::lang::NoSuchMethodError (msg); } + if (pool->tags[index] == JV_CONSTANT_InterfaceMethodref) + vtable_index = -1; + else + vtable_index = _Jv_DetermineVTableIndex + (found_class, method_name, method_signature); + + if (vtable_index == METHOD_NOT_THERE) + throw_incompatible_class_change_error + (JvNewStringLatin1 ("method not found")); + pool->data[index].rmethod = _Jv_BuildResolvedMethod(the_method, found_class, >Release-Note: >Audit-Trail: >Unformatted: