Fix segfault in Lisp when calling variadic function.
Originally a segfault could occur due to an issue with how arguments
were cleaned up after a variadic function call. After the function
call the following assembly was generated:
add esp, nargs
Where nargs was the number of arguments passed to the function. This
did not take in to account that for variadic functions, the last
several arguments are CONS'd into one argument, meaning that calling a
variadic function with <>1 variadic argument would result in a broken
stack.
Specifically this issue came up in the implementation of REDUCE, which
relied on the variadic FUNCALL.
diff --git a/src/lisp/Jmk b/src/lisp/Jmk
index 8647e85..5b00b6d 100644
--- a/src/lisp/Jmk
+++ b/src/lisp/Jmk
@@ -13,7 +13,7 @@
archetype(c)
archetype(asm)
-CFLAGS += -Ivendor/luajit/dynasm -Werror -lreadline
+CFLAGS += -Ivendor/luajit/dynasm -Werror -lreadline # -fsanitize=address
LDFLAGS += -lreadline
ASMFLAGS += -felf -Fdwarf