Yuescript
Yuescript copied to clipboard
Segfault when using macros via REPL
Typing in the following code (or any other macro I've tried) into the REPL causes a segmentation fault on Linux:
macro name_of = (ident) -> "\"#{ident}\""
$name_of hi
How you are using the Yuescript binary tool? Through luarocks install yuescript or make release? And what version of Yuescript and Lua are you using? The version of Yuescript 0.6.9 works fine with Lua 5.4 on my Linux environment. So I need more info to reproduce the problem.
I'm using the luarocks version, yuescript 0.6.6, and lua 5.4 on Arch Linux.
It should be the issue of older Yuescript. Try luarocks install yuescript again should fix the problem.
Just updated to 0.6.9, but the issue still persists for all macros. :thinking:
How about using the makefile with make release in the project folder to build the tool with the included Lua sources? It seems a Lua lib with mismatched headers got linked.
Sorry for the delay-- I'm still getting the segmentation fault with make release.
Also--
This works:
> $
macro some_macro = (name) -> "\"#{name}\""
$some_macro HI
> $
This doesn't:
> macro some_macro = (name) -> "\"#{name}\""
> $some_macro HI
Tested on archlinux with glibc 2.33 and located the problem. It is a bug in the compiler, and the minimal example to reproduce the issue is
global *
$f!
The problem should be fixed by the newest commit.