gittup / tup

Tup is a file-based build system.
http://gittup.org/tup/
GNU General Public License v2.0
1.18k stars 145 forks source link

tup aborts on nested lua file error #504

Open jp-embedded opened 3 months ago

jp-embedded commented 3 months ago

The attached project makes tup abort.

$ ../tup-v0.8/tup 
[ tup ] [0.000s] Scanning filesystem...
[ tup ] [0.000s] Reading in new environment variables...
[ tup ] [0.000s] Parsing Tupfiles...
 2) [0.001s] .
 [   ]  33%tup: luaparser.c:852: parse_lua_tupfile: Assertion `lua_gettop(gls) == 0' failed.
Aborted (core dumped)

It seems to me that parse_lua_tupfile() is invoked recursively and thus the assert should compare with what lua_gettop() would return at start of parse_lua_tupfile() instead of 0

tup-assert-test.tar.gz