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

make test has an error

itsinder opened this issue · comments

if [ uname = "Darwin" ]; then make test_macosx; else make test_posix; fi
make[1]: Entering directory '/home/i/luaffi'
LD_LIBRARY_PATH=./ lua test.lua
Running test
lua: test.lua:852: bad argument #1 to 'pairs' (table expected, got userdata)
stack traceback:
[C]: in function 'pairs'
test.lua:852: in main chunk
[C]: ?
Makefile:50: recipe for target 'test_posix' failed
make[1]: *** [test_posix] Error 1
make[1]: Leaving directory '/home/i/luaffi'
Makefile:18: recipe for target 'test' failed
make: *** [test] Error 2

The line in question is x, y = pairs(v)
v is a struct and I would actually think that we cannot iterate over a struct, but i might be wrong. If I remove the two lines that iterate over the struct using ipairs and pairs all tests pass

My lua: Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio