aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>2005-03-28 00:09:38 -0800
committerPer Bothner <bothner@gcc.gnu.org>2005-03-28 00:09:38 -0800
commit551ca039ecd06c92f3909d960c5e4be3a6368f62 (patch)
tree387b86af33906f206e0524a169e6edcbfc011212 /libjava
parent8abb6b2217202164ea30559a793ddbe364bfdd7f (diff)
downloadgcc-551ca039ecd06c92f3909d960c5e4be3a6368f62.zip
gcc-551ca039ecd06c92f3909d960c5e4be3a6368f62.tar.gz
gcc-551ca039ecd06c92f3909d960c5e4be3a6368f62.tar.bz2
boehm.cc (_Jv_MarkObj): Don't follow null pointer to static field...
* 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
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog5
-rw-r--r--libjava/boehm.cc6
2 files changed, 9 insertions, 2 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 8659e83..24faa64 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -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
diff --git a/libjava/boehm.cc b/libjava/boehm.cc
index 2e64b1c..af26c2b 100644
--- a/libjava/boehm.cc
+++ b/libjava/boehm.cc
@@ -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);
}