diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-09-25 20:14:37 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-09-25 20:14:37 +0000 |
commit | c9a4cd6dfaec0b2a9faebe4a84550dcc81a1d763 (patch) | |
tree | 95368d48d4cdd29791c619b4f3431674de247d8e /libjava/boehm.cc | |
parent | fc585b92ad73bac2e414f5a1e7658d161346eda3 (diff) | |
download | gcc-c9a4cd6dfaec0b2a9faebe4a84550dcc81a1d763.tar.gz |
* boehm.cc (_Jv_MarkObj): Don't fail if class object has been
allocated but not initialized.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57514 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/boehm.cc')
-rw-r--r-- | libjava/boehm.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libjava/boehm.cc b/libjava/boehm.cc index be2855aef72..466c9223ac8 100644 --- a/libjava/boehm.cc +++ b/libjava/boehm.cc @@ -1,6 +1,6 @@ // boehm.cc - interface between libjava and Boehm GC. -/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation +/* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation This file is part of libgcj. @@ -134,6 +134,12 @@ _Jv_MarkObj (void *addr, void *msp, void *msl, void * /* env */) p = (ptr_t) c->methods; MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c6label); + // The vtable might have been set, but the rest of the class + // could still be uninitialized. If this is the case, then + // c.isArray will SEGV. We check for this, and if it is the + // case we just return. + if (__builtin_expect (c->name == NULL, false)) + return mark_stack_ptr; if (! c->isArray() && ! c->isPrimitive()) { |