Skip to content
Snippets Groups Projects
Commit a635765f authored by Ilya Verbin's avatar Ilya Verbin Committed by Igor Munkin
Browse files

lua/utils: use index2adr() instead of index arithmetic

We have a code that performs calculations to obtain the address from the
given index, the address is then passed to cdataV() to get cdata value from
the stack. But this doesn't work for pseudo-indexes (e.g. upvalue indexes).
This patch brings index2adr() from luajit/src/lj_api.c, which accepts all
kinds of indexes, so that the calculations are no longer needed. Also the
helper function luaL_tocpointer() is introduced.

Closes #8249

NO_DOC=bugfix
parent 0fb64e5a
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment