* boehm.cc (_Jv_MarkObj): Handle case where field's type is NULL.
authorTom Tromey <tromey@redhat.com>
Fri, 24 Jun 2005 22:14:03 +0000 (22:14 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Fri, 24 Jun 2005 22:14:03 +0000 (22:14 +0000)
From-SVN: r101300

libjava/ChangeLog
libjava/boehm.cc

index bcc1eabc343af3556307f1986bf12ad11384f408..51820665d2a982aacdd91443d18561f5317a3ea8 100644 (file)
@@ -1,3 +1,7 @@
+2005-06-24  Tom Tromey  <tromey@redhat.com>
+
+       * boehm.cc (_Jv_MarkObj): Handle case where field's type is NULL.
+
 2005-06-24  Tom Tromey  <tromey@redhat.com>
 
        * verify.cc (verify_instructions_0): Correctly handle situation
index af26c2b7b36efeda49177e2f7ab716487b1d6aed..06b8f9889e86ed5c6690c39a96d1509db0fc9724 100644 (file)
@@ -1,6 +1,6 @@
 // boehm.cc - interface between libjava and Boehm GC.
 
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
    Free Software Foundation
 
    This file is part of libgcj.
@@ -191,7 +191,11 @@ _Jv_MarkObj (void *addr, void *msp, void *msl, void *env)
              // static members.
              // Note that field->u.addr may be null if the class c is
              // JV_STATE_LOADED but not JV_STATE_PREPARED (initialized).
-             if (JvFieldIsRef (field) && p && field->isResolved()) 
+             // Note also that field->type could be NULL in some
+             // situations, for instance if the class has state
+             // JV_STATE_ERROR.
+             if (field->type && JvFieldIsRef (field)
+                 && p && field->isResolved()) 
                {
                  jobject val = *(jobject*) p;
                  p = (GC_PTR) val;