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

crashes on invalid initialiser keys

justincormack opened this issue · comments

lua5.2
Lua 5.2.1  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> ffi=require "ffi"
> t=ffi.typeof("struct {int a; int b;};")
> =t(1, 2)
cdata<struct 2>: 0x117cb38
> =t{a=1, b=2}
cdata<struct 2>: 0x11530d8
> =t{a=1, c=3}
lua5.2: ffi.c:816: set_struct: Assertion `off >= 0' failed.
Aborted (core dumped)

This should not abort; luaJIT silently ignores unknown keys, raising an error ok too.