diff --git a/src/bindings/luajit/eo.lua b/src/bindings/luajit/eo.lua index 0d84aa24ee..91c3034914 100644 --- a/src/bindings/luajit/eo.lua +++ b/src/bindings/luajit/eo.lua @@ -110,8 +110,11 @@ ffi.cdef [[ extern const Eo_Event_Description _EO_BASE_EVENT_DEL; ]] +local addr_d = ffi.typeof("union { double d; const Eo *p; }") local eo_obj_addr_get = function(x) - return tonumber(ffi.cast("intptr_t", x)) + local v = addr_d() + v.p = x + return tonumber(v.d) end local cutil = require("cutil")