diff options
-rw-r--r-- | src/library_gc.js | 2 | ||||
-rw-r--r-- | system/include/gc.h | 2 | ||||
-rwxr-xr-x | tests/runner.py | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/src/library_gc.js b/src/library_gc.js index d9bb895b..75cea390 100644 --- a/src/library_gc.js +++ b/src/library_gc.js @@ -115,7 +115,7 @@ if (GC_SUPPORT) { var freeList = []; for (var ptr in GC.sizes) { if (!GC.reachable[ptr]) { - freeList.push(ptr); + freeList.push(parseInt(ptr)); } } for (var i = 0; i < freeList.length; i++) { diff --git a/system/include/gc.h b/system/include/gc.h index baeaf2b5..996bc9ec 100644 --- a/system/include/gc.h +++ b/system/include/gc.h @@ -13,6 +13,8 @@ void __attribute__((used)) __GC_KEEPALIVE__() { static int times = 1; void *x = malloc(times); free(x); + x = calloc(1, times); + free(x); x = calloc(times, 1); free(x); times++; diff --git a/tests/runner.py b/tests/runner.py index 0beea3a1..9b6bf5fa 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -6186,6 +6186,8 @@ def process(filename): printf(".\n"); global = 0; + + return 0; } ''' self.do_run(src, '''basic test |