diff --git a/HISTORY b/HISTORY index 6e536e7..80b59ba 100755 --- a/HISTORY +++ b/HISTORY @@ -1,6 +1,7 @@ Jan. 15 2016 Fixed some crash bugs with invalid syntax Fixed some memory leak with invalid syntax +Fixed an invalid GC table iteration bug Jan. 14 2016 Fixed a collection accessing bug in an assignment statement diff --git a/core/my_basic.c b/core/my_basic.c index aeb4ae4..635cb21 100755 --- a/core/my_basic.c +++ b/core/my_basic.c @@ -4670,12 +4670,18 @@ void _gc_add(_ref_t* ref, void* data, _gc_t* gc) { void _gc_remove(_ref_t* ref, void* data) { /* Remove a referenced object from GC */ + _ht_node_t* table = 0; mb_unrefvar(data); mb_assert(ref && data); - if(ref->s->gc.table) - _ht_remove(ref->s->gc.table, ref, 0); + if(ref->s->gc.collecting) + table = ref->s->gc.recursive_table; + else + table = ref->s->gc.table; + + if(table) + _ht_remove(table, ref, 0); } int _gc_add_reachable(void* data, void* extra, void* ht) { diff --git a/output/my_basic.exe b/output/my_basic.exe index 11bc217..09788d6 100755 Binary files a/output/my_basic.exe and b/output/my_basic.exe differ