diff options
author | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-28 08:09:38 +0000 |
---|---|---|
committer | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-28 08:09:38 +0000 |
commit | cbbf0e3ce1b0416b8a85ca267b7b32a7b1010a86 (patch) | |
tree | 387b86af33906f206e0524a169e6edcbfc011212 /libjava/boehm.cc | |
parent | 5fd4bf3ba37d697f707456f22289919a56198e87 (diff) | |
download | gcc-cbbf0e3ce1b0416b8a85ca267b7b32a7b1010a86.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97128 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/boehm.cc')
-rw-r--r-- | libjava/boehm.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libjava/boehm.cc b/libjava/boehm.cc index 2e64b1ca6cc..af26c2b7b36 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); } |