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

Parameterized pointer type regression #6

Closed
vsergeev opened this issue Oct 19, 2020 · 2 comments
Closed

Parameterized pointer type regression #6

vsergeev opened this issue Oct 19, 2020 · 2 comments

Comments

@vsergeev
Copy link
Contributor

local ffi = jit and require('ffi') or require('cffi')

ffi.cdef[[
typedef struct point {
    int x;
    int y;
} point_t;
]]

print(ffi.typeof("point_t")) --> ctype<struct point>
print(ffi.typeof("point_t *")) --> ctype<struct point *>
print(ffi.typeof("$ *", ffi.typeof("point_t"))) --> expected: ctype<struct point *>, get: ctype<struct point>

I'm expecting a pointer type for the parametrized typeof ffi.typeof("$ *", ffi.typeof("point_t"), but am getting the underlying structure type.

Running off of 07b30b0.

@q66 q66 closed this as completed in f8fbd26 Oct 19, 2020
q66 added a commit that referenced this issue Oct 19, 2020
@q66
Copy link
Owner

q66 commented Oct 19, 2020

this one was kind of silly, the parsing and everything was actually working right, but it was returning an incorrect value on the lua stack :P

@vsergeev
Copy link
Contributor Author

Great, thanks 👍 Works for me now.

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