]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
boehm.cc (_Jv_MarkObj): Don't follow null pointer to static field...
authorPer Bothner <per@bothner.com>
Mon, 28 Mar 2005 08:09:38 +0000 (00:09 -0800)
committerPer Bothner <bothner@gcc.gnu.org>
Mon, 28 Mar 2005 08:09:38 +0000 (00:09 -0800)
* boehm.cc (_Jv_MarkObj): Don't follow null pointer to static field,
which can happen if class is JV_STATE_LOADED but not JV_STATE_PREPARED.

From-SVN: r97128

libjava/ChangeLog
libjava/boehm.cc

index 8659e83517022f3605868bb81f41e1a8eb19a5ab..24faa64a22da31274723272f7999025045d63b13 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-28  Per Bothner  <per@bothner.com>
+
+       * boehm.cc (_Jv_MarkObj): Don't follow null pointer to static field,
+       which can happen if class is JV_STATE_LOADED but not JV_STATE_PREPARED.
+
 2005-03-27  Andreas Tobler  <a.tobler@schweiz.ch>
 
        * Makefile.am (classes.stamp): Add gnu/gcj/tools/gcj_dbtool/Main.java
index 2e64b1ca6cce5806f11c215f9a2de25be9bef49d..af26c2b7b36efeda49177e2f7ab716487b1d6aed 100644 (file)
@@ -189,9 +189,11 @@ _Jv_MarkObj (void *addr, void *msp, void *msl, void *env)
              // mark also the value pointed to.  We check for isResolved
              // since marking can happen before memory is allocated for
              // static members.
-             if (JvFieldIsRef (field) && field->isResolved()) 
+             // 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()) 
                {
-                 jobject val = *(jobject*) field->u.addr;
+                 jobject val = *(jobject*) p;
                  p = (GC_PTR) val;
                  MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
                }