jmckaskill / luaffi

Standalone FFI library for calling C functions from lua. Compatible with the luajit FFI interface.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Equality comparison of integers always false

petercolberg opened this issue · comments

The following test case fails with Lua 5.2 and lua-ffi abc638c on Linux x86_64.

local ffi = require("ffi")
assert((ffi.new("int", 42) > 42) == false)
assert((ffi.new("int", 42) >= 42) == true)
assert((ffi.new("int", 42) <= 42) == true)
assert((ffi.new("int", 42) < 42) == false)
assert((ffi.new("int", 42) == 42) == true) --> assertion failed!