From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20857 invoked by alias); 12 Jul 2011 12:50:06 -0000 Received: (qmail 20846 invoked by uid 22791); 12 Jul 2011 12:50:05 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 Jul 2011 12:49:43 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6CCnhQ0004504 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 12 Jul 2011 08:49:43 -0400 Received: from zebedee.pink (ovpn-113-63.phx2.redhat.com [10.3.113.63]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p6CCngE5023527; Tue, 12 Jul 2011 08:49:42 -0400 Message-ID: <4E1C42E5.10107@redhat.com> Date: Tue, 12 Jul 2011 12:50:00 -0000 From: Andrew Haley User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Thunderbird/3.1.10 MIME-Version: 1.0 To: GCJ-patches Subject: Fix thinko in java::lang::Class::finalize Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-patches-owner@gcc.gnu.org X-SW-Source: 2011-q3/txt/msg00019.txt.bz2 This one is pretty obvious. We never noticed it before because finalizers are run in a try block that catches all exceptions, including the NullPointerException this always throws. Andrew. 2011-07-12 Andrew Haley * java/lang/natClass.cc (finalize): Make sure that the class really has an engine. Index: java/lang/natClass.cc =================================================================== --- java/lang/natClass.cc (revision 176198) +++ java/lang/natClass.cc (working copy) @@ -668,7 +668,9 @@ void java::lang::Class::finalize (void) { - engine->unregister(this); + // Array classes don't have an engine, and don't need to be finalized. + if (engine) + engine->unregister(this); } #ifdef INTERPRETER