[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Incompatibility of lua5.1.dll (from Lua Binaries) and Delphi
- From: Shmuel Zeigerman <shmuz@...>
- Date: Fri, 13 Mar 2009 13:22:00 +0200
Hello,
Recently I got a bugreport (a segfault in "LuaFAR for Editor"). After
some debugging it appeared that lua5.1.dll from Lua Binaries produces a
segfault after a DLL built with Borland Delphi (or C++ Builder) is
loaded. (My lua5.1.dll built with GCC is OK in this respect).
Here is a test case
--------------------------------------------------------------
-- (1) lib.dll: libfile.cpp
#include <vcl.h>
extern "C" {
#include <lua.h>
int luaopen_lib(lua_State* L) { return 0; }
}
-- (2) lib.dll: lib.def
EXPORTS
luaopen_lib = _luaopen_lib
-- (3) test.lua
require ("lib")
loadstring ("local var = 0x80000000")
--------------------------------------------------------------
What's interesting, segfaults occur only when a number assigned to 'var'
is >= 0x80000000.
BTW, Delphi DLL doesn't have to be Lua module (as in my test case), it
is sufficient that it is loaded by the application before executing the
Lua code above.
--
Shmuel