* src/native/localref.c (localref_add, localref_del): Added assertion.
void _Jv_JNI_DeleteLocalRef(JNIEnv *env, jobject localRef)
{
- java_handle_t *o;
+ java_handle_t *o;
STATISTICS(jniinvokation());
o = (java_handle_t *) localRef;
+ if (o == NULL)
+ return NULL;
+
/* delete the reference */
localref_del(o);
STATISTICS(jniinvokation());
- if (ref == NULL)
- return NULL;
-
o = (java_handle_t *) ref;
+ if (o == NULL)
+ return NULL;
+
/* insert the reference */
localref = localref_add(LLNI_DIRECT(o));
java_handle_t *h;
int32_t i;
-#if !defined(NDEBUG)
- if (o == NULL) {
- log_println("localref_add: WARNING: trying to add localref for (NIL)!");
- return NULL;
- }
-#endif
-
/* get current local reference table from thread */
lrt = LOCALREFTABLE;
assert(lrt != NULL);
+ assert(o != NULL);
/* XXX: assert that we are in a GC critical section! */
/* Check if we have space for the requested reference? No,
lrt = LOCALREFTABLE;
assert(lrt != NULL);
+ assert(localref != NULL);
localframes = lrt->localframes;