shithub: sl

Download patch

ref: ba74a11881066a1ff0b2941707d7a73d45931916
parent: 439510c77f14f7484b937bf247013b8500315d3d
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Thu Jan 30 22:38:44 EST 2025

relocate: copy gensym type

It is absolutely required as alloc_words does not memset.
Not doing that would result in weird crashes when doing gc
at specific points.

--- a/src/flisp.c
+++ b/src/flisp.c
@@ -430,6 +430,7 @@
 		gensym_t *ng = alloc_words(sizeof(gensym_t)/sizeof(value_t));
 		ng->id = gs->id;
 		ng->binding = gs->binding;
+		ng->type = gs->type;
 		nc = tagptr(ng, TAG_SYM);
 		forward(v, nc);
 		if(fl_likely(ng->binding != UNBOUND))