Patch: jni.cc fixes
Tom Tromey
tromey@cygnus.com
Tue Mar 14 13:59:00 GMT 2000
This patch fixes a couple bugs that are revelead if you enable
assertions. I'm checking it in.
2000-03-14 Tom Tromey <tromey@cygnus.com>
* jni.cc (mangled_name): Fixed assertion.
(JNI_GetCreatedJavaVMs): Don't comment out `buf_len' argument;
turned assert into actual failure.
Tom
Index: jni.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/jni.cc,v
retrieving revision 1.26
diff -u -r1.26 jni.cc
--- jni.cc 2000/03/07 19:55:24 1.26
+++ jni.cc 2000/03/14 21:57:27
@@ -1606,7 +1606,7 @@
const unsigned char *sig = (const unsigned char *) signature->data;
limit = sig + signature->length;
- JvAssert (signature[0] == '(');
+ JvAssert (sig[0] == '(');
++sig;
while (1)
{
@@ -1958,9 +1958,11 @@
}
jint
-JNI_GetCreatedJavaVMs (JavaVM **vm_buffer, jsize /* buf_len */, jsize *n_vms)
+JNI_GetCreatedJavaVMs (JavaVM **vm_buffer, jsize buf_len, jsize *n_vms)
{
- JvAssert (buf_len > 0);
+ if (buf_len <= 0)
+ return JNI_ERR;
+
// We only support a single VM.
if (the_vm != NULL)
{
More information about the Java-patches
mailing list