lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

I have a chunk of C code that is loading the Lua bytecode (generated using luac). The C code invokes a Lua function. But the Lua VM is not able to find the function.

Used the luac to generate the listing to check if the symbol (function) is present in the bytecode and it sure was.

Anyone has an idea?  Call flow in C code as below

// Open Lua standard libraries - basic, table, string , etc
// Load App SDK - push C functions
luaL_loadbuffer -- to load bytecode

All the above calls are successful.

lua_getglobal(luaState, func);
lua_isfunction(luaState,-1)  ---> THIS IS FAILING

Please let me know for additional info.