natClass.cc (registerClosure): Make sure closures is non NULL.
authorAndrew Haley <aph@redhat.com>
Tue, 26 Jan 2010 18:59:16 +0000 (18:59 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Tue, 26 Jan 2010 18:59:16 +0000 (18:59 +0000)
2010-01-26  Andrew Haley  <aph@redhat.com>

* java/lang/natClass.cc (registerClosure): Make sure closures is
non NULL.

From-SVN: r156257

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

index 37b8ec4aec2c2cf49b6ccdd2b5139ac1e2c3b338..3a9b46263f64da433cefbf85a73350b293555477 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 5b141605f92f78259eda735d2825537f64199328..fb7da4a86254e9f4e2799da9237e07a5753008fd 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