{
localref_table *lrt;
java_handle_t *h;
+ int32_t localframes;
int32_t i;
/* get local reference table from thread */
assert(lrt != NULL);
- /* go through all local frames */
+ localframes = lrt->localframes;
+
+ /* go through all local frames of the current table */
+ /* XXX: this is propably not what the spec wants! */
- /* XXX: this is definitely not what the spec wants! */
- /*for (; lrt != NULL; lrt = lrt->prev) {*/
+ for (; localframes > 0; localframes--) {
/* and try to remove the reference */
return;
}
}
- /*}*/
+
+ lrt = lrt->prev;
+ }
/* this should not happen */