2010-01-26 Andrew Haley <aph@redhat.com>
authoraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Jan 2010 18:59:16 +0000 (18:59 +0000)
committeraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Jan 2010 18:59:16 +0000 (18:59 +0000)
* java/lang/natClass.cc (registerClosure): Make sure closures is
non NULL.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156257 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/java/lang/natClass.cc

index 37b8ec4..3a9b462 100644 (file)
@@ -1,3 +1,8 @@
+2010-01-26  Andrew Haley  <aph@redhat.com>
+
+       * java/lang/natClass.cc (registerClosure): Make sure closures is
+       non NULL.
+
 2010-01-19  Matthias Klose  <doko@ubuntu.com>
 
        * Regenerate .class files.
index 5b14160..fb7da4a 100644 (file)
@@ -689,9 +689,12 @@ void
 _Jv_ClosureList::registerClosure (jclass klass, void *ptr)
 {
   _Jv_ClosureList **closures = klass->engine->get_closure_list (klass);
-  this->ptr = ptr;
-  this->next = *closures;
-  *closures = this;
+  if (closures)
+    {
+      this->ptr = ptr;
+      this->next = *closures;
+      *closures = this;
+    }
 }
 #endif