From 780590d1d2ca12a870987b620c4dafd77f55e8a3 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 10 Jun 2023 17:14:09 -0700 Subject: lib: string bug spotted on Solaris. * lib.c (string_finish): On platforms where we do not HAVE_MALLOC_USABLE_SIZE, there is a compiler diagnostic. The code is inappropriately using the set macro and mkloc to assign the st->st.alloc member, which is just a number (cnum type), and not a val. The set macro is only needed when mutating a gc heap object to point to another gc heap object. --- lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib.c b/lib.c index 4ad63431..c52f9575 100644 --- a/lib.c +++ b/lib.c @@ -5230,7 +5230,7 @@ val string_finish(val str) alloc = len + 1; str->st.str = chk_wrealloc(str->st.str, alloc); #if !HAVE_MALLOC_USABLE_SIZE - set(mkloc(str->st.alloc, str), num(alloc)); + str->st.alloc = alloc; #endif } } -- cgit v1.2.3