* src/native/localref.c (localref_del): Go through all local frames.
authorMichael Starzinger <michi@complang.tuwien.ac.at>
Mon, 3 Sep 2007 21:46:18 +0000 (23:46 +0200)
committerMichael Starzinger <michi@complang.tuwien.ac.at>
Mon, 3 Sep 2007 21:46:18 +0000 (23:46 +0200)
src/native/localref.c

index 8d3ce8093b941746973e6ddb44635cc8d4939a58..4fe98d2326cf28a8ec64f9e101fcd6e61dca865b 100644 (file)
@@ -380,6 +380,7 @@ void localref_del(java_handle_t *localref)
 {
        localref_table *lrt;
        java_handle_t  *h;
+       int32_t         localframes;
        int32_t         i;
 
        /* get local reference table from thread */
@@ -388,10 +389,12 @@ void localref_del(java_handle_t *localref)
 
        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 */
     
@@ -409,7 +412,9 @@ void localref_del(java_handle_t *localref)
                                return;
                        }
                }
-       /*}*/
+
+               lrt = lrt->prev;
+       }
 
        /* this should not happen */