-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
fix(env) luajit table overflow error when using ffi.cdef #8945
Conversation
@ms2008, |
@bungle Sorry, I am not very familiar with the valut thing. I see it being called here: Lines 163 to 165 in 802e1aa
will eventually be called by this method: Line 388 in 802e1aa
It looks like it might be called multiple times if I understand correctly: Lines 1744 to 1760 in 802e1aa
|
Good point. Let me check this too. The init might not be needed there, let me see. This is quite complicated as it has to work on CLI etc. |
FTI-5896 --------- Co-authored-by: Qi <add_sp@outlook.com>
Summary
There is a potential risk that if
init
is invoked a lot, a table overflow error will occur. Can be verified very simply by:It's wrong to call
ffi.cdef()
repeatedly for the same things. Always call it on the top-level scope of module files.Full changelog
ffi.cdef