summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2023-01-31 08:53:54 +0300
committerIvan Maidanski <ivmai@mail.ru>2023-01-31 17:09:49 +0300
commit513ecade2f950f56f17e6d7db1d7a1be851401f1 (patch)
treef0b87badf9453062f7612675e57a95f6abbe40ca /tests
parentba3051bed088c0cdc3ee221e911b87983ac5e475 (diff)
downloadbdwgc-513ecade2f950f56f17e6d7db1d7a1be851401f1.tar.gz
Fix pointer visibility in gcj_cons
(fix of commit fcbfe2a78) The issue is caused by the mixture of debug and non-debug routine calls (the pointer is allocated by GC_gcj_malloc_ignore_off_page but accessed by the debug variant of GC_PTR_STORE_AND_DIRTY). * tests/gctest.c [GC_GCJ_SUPPORT] (gcj_cons): Call GC_GCJ_MALLOC_IGNORE_OFF_PAGE() instead of GC_gcj_malloc_ignore_off_page().
Diffstat (limited to 'tests')
-rw-r--r--tests/gctest.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/gctest.c b/tests/gctest.c
index ef8fd9cc..78995162 100644
--- a/tests/gctest.c
+++ b/tests/gctest.c
@@ -425,7 +425,7 @@ sexpr small_cons_uncollectable (sexpr x, sexpr y)
GC_word cnt = (GC_word)AO_fetch_and_add1(&extra_count);
void *d = (cnt & 1) != 0 ? &gcj_class_struct1 : &gcj_class_struct2;
size_t lb = sizeof(struct SEXPR) + sizeof(struct fake_vtable*);
- void *r = (cnt & 2) != 0 ? GC_gcj_malloc_ignore_off_page(lb
+ void *r = (cnt & 2) != 0 ? GC_GCJ_MALLOC_IGNORE_OFF_PAGE(lb
+ (cnt <= HBLKSIZE / 2 ? cnt : 0), d)
: GC_GCJ_MALLOC(lb, d);