Compiling Lua 5.2 using MINGW32 creates a library (lua52.dll) that may crash the host application when a Lua error occurs.
I detected this bug by making a Lua syntax error in a test script. If the script had no errors at all, the host program ran it successfully. However, when loading an invalid script (e.g. with a missing THEN in an IF block) the host program crashed.
Here is a fragment of my code:
//Load the script
int status = luaL_loadfile(L, "foo.lua");
if (status == 0) {
//Run the script
....
} else {
warn("LUA script error: %d. %s", status, lua_tostring(L, -1));
lua_pop(L, 1);
}
If the script has no syntax errors, statusis 0 and the script is successfully executed. Otherwise, luaL_loadfile does not return and the program crashes.