summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-05-27 07:38:57 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-05-27 07:38:57 -0700
commit7457dbd640d599fb79886af46aa900bea0e124ff (patch)
tree0e75b022f2d4dbd5cb594757b7a4452526057264
parent88ad50aef5d3676c0c963c46c3da21e4b9973004 (diff)
downloadtxr-7457dbd640d599fb79886af46aa900bea0e124ff.tar.gz
txr-7457dbd640d599fb79886af46aa900bea0e124ff.tar.bz2
txr-7457dbd640d599fb79886af46aa900bea0e124ff.zip
gc: bug: fix compilation if HAVE_VALGRIND.
* gc.c (mark_obj_maybe): Avoid declaration after statement, which is enforced when configured in --maintainer mode.
-rw-r--r--gc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index 0c727ed4..1f0d0e9f 100644
--- a/gc.c
+++ b/gc.c
@@ -517,11 +517,12 @@ static void mark_obj_maybe(val maybe_obj)
VALGRIND_MAKE_MEM_DEFINED(&maybe_obj, sizeof maybe_obj);
#endif
if (in_heap(maybe_obj)) {
+ type_t t;
#if HAVE_VALGRIND
if (opt_vg_debug)
VALGRIND_MAKE_MEM_DEFINED(maybe_obj, SIZEOF_PTR);
#endif
- type_t t = maybe_obj->t.type;
+ t = maybe_obj->t.type;
if ((t & FREE) == 0) {
mark_obj(maybe_obj);
} else {