aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-05-15 16:01:35 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-05-15 16:01:35 -0700
commit499ace020e95c574255dc9aa3604db441d54702c (patch)
tree3334d4a3cf31d9c439094aacd284220ecaccb22a
parent8331c32384e33fc865d03acab630759527304451 (diff)
fix test_gc for o1 and o2
-rw-r--r--src/library_gc.js2
-rw-r--r--system/include/gc.h2
-rwxr-xr-xtests/runner.py2
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