Patch: runtime support for `null this' patch

Tom Tromey tromey@cygnus.com
Thu Apr 27 16:13:00 GMT 2000


I'm checking this in.  It is the runtime part of my fix for PR 2.

2000-04-05  Tom Tromey  <tromey@cygnus.com>

	Runtime support for PR gcj/2:
	* prims.cc (_Jv_ThrowNullPointerException): New function.
	* include/jvm.h (_Jv_ThrowNullPointerException): Declare.

Tom

Index: include/jvm.h
===================================================================
RCS file: /cvs/java/libgcj/libjava/include/jvm.h,v
retrieving revision 1.23
diff -u -r1.23 jvm.h
--- jvm.h	2000/04/22 17:09:38	1.23
+++ jvm.h	2000/04/27 23:11:11
@@ -186,6 +186,7 @@
 }
 
 extern "C" void _Jv_ThrowBadArrayIndex (jint bad_index);
+extern "C" void _Jv_ThrowNullPointerException (void);
 extern "C" jobject _Jv_NewArray (jint type, jint size)
   __attribute__((__malloc__));
 extern "C" jobject _Jv_NewMultiArray (jclass klass, jint dims, ...)
Index: prims.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/prims.cc,v
retrieving revision 1.27
diff -u -r1.27 prims.cc
--- prims.cc	2000/04/27 11:47:13	1.27
+++ prims.cc	2000/04/27 23:11:14
@@ -303,6 +303,12 @@
 	   (java::lang::String::valueOf(bad_index)));
 }
 
+void
+_Jv_ThrowNullPointerException ()
+{
+  throw new java::lang::NullPointerException ();
+}
+
 // Allocate some unscanned memory and throw an exception if no memory.
 void *
 _Jv_AllocBytesChecked (jsize size)


More information about the Java-patches mailing list