From 1348d9d446428a3afc8900881b61ed7bbdffe5f5 Mon Sep 17 00:00:00 2001 From: ivmai Date: Mon, 4 Apr 2011 19:45:06 +0000 Subject: [PATCH] 2011-04-04 Ivan Maidanski * tests/test.c (reverse_test_inner): Undo one of the previous patches which shifts "c" and "d" pointers only if ALL_INTERIOR_POINTERS (since interior pointers are always recognized in stacks). --- ChangeLog | 7 +++++++ tests/test.c | 17 +++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index c349fc5c..26522ba0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-04-04 Ivan Maidanski + + * tests/test.c (reverse_test_inner): Undo one of the previous + patches which shifts "c" and "d" pointers only if + ALL_INTERIOR_POINTERS (since interior pointers are always + recognized in stacks). + 2011-04-03 Ivan Maidanski * misc.c (GC_stdout, GC_stderr): Move the definition to the place diff --git a/tests/test.c b/tests/test.c index ee0cd97c..d6e2fc88 100644 --- a/tests/test.c +++ b/tests/test.c @@ -585,14 +585,12 @@ void *GC_CALLBACK reverse_test_inner(void *data) h[1999] = ints(1,200); # endif /* Try to force some collections and reuse of small list elements */ - for (i = 0; i < 10; i++) { - (void)ints(1, BIG); - } -# ifdef ALL_INTERIOR_POINTERS - /* Superficially test interior pointer recognition on stack */ - c = (sexpr)((char *)c + sizeof(char *)); - d = (sexpr)((char *)d + sizeof(char *)); -# endif + for (i = 0; i < 10; i++) { + (void)ints(1, BIG); + } + /* Superficially test interior pointer recognition on stack */ + c = (sexpr)((char *)c + sizeof(char *)); + d = (sexpr)((char *)d + sizeof(char *)); GC_FREE((void *)e); @@ -623,8 +621,11 @@ void *GC_CALLBACK reverse_test_inner(void *data) } check_ints(a,1,49); check_ints(b,1,50); + + /* Restore c and d values. */ c = (sexpr)((char *)c - sizeof(char *)); d = (sexpr)((char *)d - sizeof(char *)); + check_ints(c,1,BIG); check_uncollectable_ints(d, 1, 100); check_ints(f[5], 1,17); -- 2.40.0