Page 1 of 1
Compiling With Lua 5.2 Compatibility
Posted: Tue Feb 11, 2014 3:11 am
by ejmr
Now that LÖVE uses LuaJIT, has anyone compiled it with the -DLUAJIT_ENABLE_LUA52COMPAT flag? I was thinking about do so as an experiment but first wanted to ask if anyone else had already tried, and if so what problems they ran into when attempting to run existing LÖVE games.
Re: Compiling With Lua 5.2 Compatibility
Posted: Mon Mar 03, 2014 12:41 pm
by ejmr
I haven’t yet done extensive testing, but LÖVE compiles with LuaJIT’s 5.2 compatibility flag without any problems.
Re: Compiling With Lua 5.2 Compatibility
Posted: Mon Mar 03, 2014 5:01 pm
by Xgoff
just keep in mind that it is far from complete compatibility
Re: Compiling With Lua 5.2 Compatibility
Posted: Mon Mar 03, 2014 5:26 pm
by ejmr
I am aware. But it is nice to be able to use 'goto'. :gasp:
lol
Re: Compiling With Lua 5.2 Compatibility
Posted: Mon Mar 03, 2014 5:40 pm
by slime
LuaJIT actually lets you use goto without compiling with the -DLUAJIT_ENABLE_LUA52COMPAT flag. See
http://luajit.org/extensions.html#lua52 .
Re: Compiling With Lua 5.2 Compatibility
Posted: Mon Mar 03, 2014 6:04 pm
by ejmr
That is true. I simply have the habit of associating it with the flag so that ’goto’ is treated as a keyword.
Re: Compiling With Lua 5.2 Compatibility
Posted: Tue Mar 04, 2014 7:45 am
by bartbes
I'm fairly sure we went ahead and made love compile against lua 5.2 (at least in compat mode) somewhere before the 0.9.0 release.
Re: Compiling With Lua 5.2 Compatibility
Posted: Tue Mar 04, 2014 4:00 pm
by ejmr
Thanks for the info bartbes. Is there any plan to continue to do so, i.e. official support, or was it instead simply experimentation? Personally, now with LuaJIT being the foundation I do not see tremendous benefits in also maintaining compatibility with Lua 5.2, but it would be nice if the upkeep wasn't difficult.
Re: Compiling With Lua 5.2 Compatibility
Posted: Wed Mar 05, 2014 12:53 am
by Inny
I'd just like to make the piercing jab that bad use of the goto statement has been the underlying cause of two recently discovered dramatic security flaws.
Re: Compiling With Lua 5.2 Compatibility
Posted: Thu Mar 06, 2014 6:42 pm
by Xgoff
Inny wrote:I'd just like to make the piercing jab that bad use of the goto statement has been the underlying cause of two recently discovered dramatic security flaws.
not really, the apple bug was mainly the result of not using braces around the if statements, possibly due to a merge/copy+paste error i would guess. in this particular case, they
should have just put that freeing code in a function and tailcalled it, but this bug would have happened if eg they had set a "fail" variable instead... 'cause you know, having more than one return statement from a function is almost as bad as goto!!! also i imagine their compiler would have--and SHOULD have--caught this
the tls bug may well still have happened if they had used another method; if you had written code to jump to the wrong label, you probably would have used the wrong function call or return value or whatever, too
tl;dr goto in code, must be source of all problems
</offtopic>