aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2002-09-25 20:14:37 +0000
committerTom Tromey <tromey@gcc.gnu.org>2002-09-25 20:14:37 +0000
commit7ea082bbb514fb2b9afbb8f081e21f287ba86431 (patch)
tree95368d48d4cdd29791c619b4f3431674de247d8e /libjava
parent941b08f2734f6a5cbeaeb9e82fe931fd3badc1ae (diff)
downloadgcc-7ea082bbb514fb2b9afbb8f081e21f287ba86431.zip
gcc-7ea082bbb514fb2b9afbb8f081e21f287ba86431.tar.gz
gcc-7ea082bbb514fb2b9afbb8f081e21f287ba86431.tar.bz2
boehm.cc (_Jv_MarkObj): Don't fail if class object has been allocated but not initialized.
* boehm.cc (_Jv_MarkObj): Don't fail if class object has been allocated but not initialized. From-SVN: r57514
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog5
-rw-r--r--libjava/boehm.cc8
2 files changed, 12 insertions, 1 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index b1f7f40..d4a611b 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,8 @@
+2002-09-25 Tom Tromey <tromey@redhat.com>
+
+ * boehm.cc (_Jv_MarkObj): Don't fail if class object has been
+ allocated but not initialized.
+
2002-09-25 Jesse Rosenstock <jmr@ugcs.caltech.edu>
Fix for PR libgcj/7766:
diff --git a/libjava/boehm.cc b/libjava/boehm.cc
index be2855a..466c922 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())
{