summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorivmai <ivmai>2011-06-30 17:43:44 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:07:00 +0200
commitcea7d64af0f72989c690b0b0b8655a5f2d7ab2ad (patch)
tree0503f942088470083b0a292980ce05f8a35d860f /tests
parent45a388771686fd791fc753fa877fc794b04d3c32 (diff)
2011-06-30 Ivan Maidanski <ivmai@mail.ru>
* dyn_load.c (GC_register_map_entries): Remove "count" local variable as unused. * gc_dlopen.c (disable_gc_for_dlopen): Define only if not USE_PROC_FOR_LIBRARIES. * malloc.c (calloc): Add parentheses around '&&' operator. * mark.c (GC_noop_sink): New global variable (instead of a static local variable inside GC_noop1). * mark.c (GC_noop1): Use GC_noop_sink variable (to prevent "variable set but not used" compiler warning). * include/private/gcconfig.h (USE_PROC_FOR_LIBRARIES): Define only if undefined yet. * tests/smash_test.c (main): Don't dereference "p" local variable if it is NULL. * tests/staticrootslib.c (main): Ditto.
Diffstat (limited to 'tests')
-rw-r--r--tests/smash_test.c2
-rw-r--r--tests/staticrootslib.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/tests/smash_test.c b/tests/smash_test.c
index 86e081b..0e8b1f0 100644
--- a/tests/smash_test.c
+++ b/tests/smash_test.c
@@ -22,7 +22,7 @@ int main(void)
A[i] = p = GC_MALLOC(SIZE);
if (i%3000 == 0) GC_gcollect();
- if (i%5678 == 0) p[SIZE + i/2000] = 42;
+ if (i%5678 == 0 && p != 0) p[SIZE + i/2000] = 42;
}
return 0;
}
diff --git a/tests/staticrootslib.c b/tests/staticrootslib.c
index 16f3352..2a8fcd4 100644
--- a/tests/staticrootslib.c
+++ b/tests/staticrootslib.c
@@ -19,8 +19,10 @@ struct treenode * libsrl_mktree(int i)
struct treenode * r = GC_MALLOC(sizeof(struct treenode));
if (0 == i) return 0;
if (1 == i) r = GC_MALLOC_ATOMIC(sizeof(struct treenode));
- r -> x = libsrl_mktree(i-1);
- r -> y = libsrl_mktree(i-1);
+ if (r) {
+ r -> x = libsrl_mktree(i-1);
+ r -> y = libsrl_mktree(i-1);
+ }
return r;
}