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

global_table_entry name field is wrong type in lua #4862

Open
ab9rf opened this issue Aug 14, 2024 · 2 comments
Open

global_table_entry name field is wrong type in lua #4862

ab9rf opened this issue Aug 14, 2024 · 2 comments

Comments

@ab9rf
Copy link
Member

ab9rf commented Aug 14, 2024

this field is a ptr-string in structures and is a pointer to a null-terminated (C-style) string, but Lua interprets its as a pointer to a single character

@ab9rf
Copy link
Member Author

ab9rf commented Aug 14, 2024

this appears to be because codegen generates lua metadata that identifies the field as a "pointer to a single character" instead of identifying it as a C-style string

@ab9rf
Copy link
Member Author

ab9rf commented Aug 14, 2024

further research: codegen emits this as { FLD(POINTER, name), identity_traits<char >::get(), 0, 0 },. it should be { FLD(PRIMITIVE, name), TID(char*), 0, 0 }, which would result in it being mapped to ptr_string_identity. which is what identity_traits<char*>::get() returns, and is the desired type identity for a C-style string

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

1 participant