mirror of
https://github.com/lua/lua
synced 2026-09-29 04:35:58 +03:00
Fix in the definition of 'sizeLclosure'
The array at the end of a Lua closure has pointers to upvalues, not to tagged values. This bug cannot cause any issue: The ISO C standard requires that all pointers to structures have the same representation, so sizeof(TValue*) must be equal to sizeof(UpVal*).
This commit is contained in:
parent
04e495403b
commit
975d4e0592
1 changed files with 1 additions and 1 deletions
2
lfunc.h
2
lfunc.h
|
|
@ -15,7 +15,7 @@
|
|||
(offsetof(CClosure, upvalue) + sizeof(TValue) * cast_uint(n))
|
||||
|
||||
#define sizeLclosure(n) \
|
||||
(offsetof(LClosure, upvals) + sizeof(TValue *) * cast_uint(n))
|
||||
(offsetof(LClosure, upvals) + sizeof(UpVal *) * cast_uint(n))
|
||||
|
||||
|
||||
/* test whether thread is in 'twups' list */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue