Compiling With Lua 5.2 Compatibility
- ejmr
- Party member
- Posts: 302
- Joined: Fri Jun 01, 2012 7:45 am
- Location: South Carolina, U.S.A.
- Contact:
Compiling With Lua 5.2 Compatibility
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.
- ejmr
- Party member
- Posts: 302
- Joined: Fri Jun 01, 2012 7:45 am
- Location: South Carolina, U.S.A.
- Contact:
Re: Compiling With Lua 5.2 Compatibility
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
just keep in mind that it is far from complete compatibility
- ejmr
- Party member
- Posts: 302
- Joined: Fri Jun 01, 2012 7:45 am
- Location: South Carolina, U.S.A.
- Contact:
Re: Compiling With Lua 5.2 Compatibility
I am aware. But it is nice to be able to use 'goto'. :gasp:
lol
lol
- slime
- Solid Snayke
- Posts: 3170
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Compiling With Lua 5.2 Compatibility
LuaJIT actually lets you use goto without compiling with the -DLUAJIT_ENABLE_LUA52COMPAT flag. See http://luajit.org/extensions.html#lua52 .
- ejmr
- Party member
- Posts: 302
- Joined: Fri Jun 01, 2012 7:45 am
- Location: South Carolina, U.S.A.
- Contact:
Re: Compiling With Lua 5.2 Compatibility
That is true. I simply have the habit of associating it with the flag so that ’goto’ is treated as a keyword.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Compiling With Lua 5.2 Compatibility
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.
- ejmr
- Party member
- Posts: 302
- Joined: Fri Jun 01, 2012 7:45 am
- Location: South Carolina, U.S.A.
- Contact:
Re: Compiling With Lua 5.2 Compatibility
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
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
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 thisInny 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.
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>
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests