Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dealing with cdata VLA #27

Open
sonoro1234 opened this issue Mar 26, 2021 · 1 comment
Open

Dealing with cdata VLA #27

sonoro1234 opened this issue Mar 26, 2021 · 1 comment

Comments

@sonoro1234
Copy link

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.

@gvx
Copy link
Owner

gvx commented Mar 31, 2021

If you have the solution, please, be my guest!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants