Strange global variable access
Closed this issue · 8 comments
Failed to install FFI-based bindings: [string "zmq"]:7: attempted to access undeclared global: disable_ffi
I've got a global environment protection system installed, that prohibits any unauthorized access to global variables.
Can this disable_ffi
be hidden into zmq
module table?
It needs to be definited before the module zmq is loaded. It is mainly for testing/debugging by bindings that have LuaJIT2 FFI support.
This thing messes up with my diagnostics. I can add it to exceptions list, but the name is too generic.
Really, global variables are ugly.
yeah, I am trying to think of a better solution.
Well, it will be more or less bearable if it will be named like NATIVE_OBJECTS_DISABLE_FFI_
or so. I can add it to the exception list and be less afraid that it will accidentally match some actual variable from the code.
That being said, if you will figure out how to get rid of a global variable, it would be more elegant :-)
I am just going to remove the use of 'disable_ffi'. It is not that important. Maybe later I will use getenv() to test for "NATIVE_OBJECTS_DISABLE_FFI" in the OS environment or something like that. I will commit the change in a minute.
done.
Thanks.
BTW, other option may be to create an actual module table for native objects in package.preloaded
and look this option there...
Fix confirmed, thank you.