bitser
bitser copied to clipboard
Dealing with cdata VLA
Hi,
VLA cdata makes bitser to error
This script runs ok but uncomenting comented lines (and comenting the two lines below) it will error
local ffi = require"ffi"
local bitser = require"bitser"
--local vecN = ffi.typeof("float[?]")
--local a = vecN(5,{1,2,3,4,5})
local vecN = ffi.typeof("float[5]")
local a = vecN({1,2,3,4,5})
local b = bitser.loads(bitser.dumps(a))
print(a,b,b[0],b[1])
I can propose a PR to fix it if you wish.
If you have the solution, please, be my guest!