Browse Source

Blocks access to ffi in LuaJIT before the user script is loaded

tags/v1.3.0
Leonardo Laguna Ruiz 4 years ago
parent
commit
33fed25130
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      src/LuaJITEngine.cpp

+ 4
- 1
src/LuaJITEngine.cpp View File

@@ -112,7 +112,10 @@ struct LuaJITEngine : ScriptEngine {
<< "float *switchLights[" << NUM_ROWS + 1 << "];" << std::endl
<< "};]]" << std::endl
// Declare the function `_castBlock` used to transform `luaBlock` pointer into a LuaJIT cdata
<< "function _castBlock(b) return ffi.cast('struct LuaProcessBlock*', b) end";
<< "_ffi_cast = ffi.cast" << std::endl
<< "function _castBlock(b) return _ffi_cast('struct LuaProcessBlock*', b) end" << std::endl
// Unload ffi and require
<< "ffi = nil; require = nil;" << std::endl;
std::string ffi_script = ffi_stream.str();

// Compile the ffi script


Loading…
Cancel
Save