lua: cast through uintptr_t when return a pointer
Don't assume size_t can carry pointer provenance and use uintptr_t (identialy on all current platforms) instead. Reviewed-by: Matthew Ahrens <mahrens@delphix.com> Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu> Signed-off-by: Brooks Davis <brooks.davis@sri.com> Closes #14131
This commit is contained in:
parent
b9041e1f27
commit
84477e148d
@ -444,7 +444,7 @@ LUA_API const void *lua_topointer (lua_State *L, int idx) {
|
||||
case LUA_TTABLE: return hvalue(o);
|
||||
case LUA_TLCL: return clLvalue(o);
|
||||
case LUA_TCCL: return clCvalue(o);
|
||||
case LUA_TLCF: return cast(void *, cast(size_t, fvalue(o)));
|
||||
case LUA_TLCF: return cast(void *, cast(uintptr_t, fvalue(o)));
|
||||
case LUA_TTHREAD: return thvalue(o);
|
||||
case LUA_TUSERDATA:
|
||||
case LUA_TLIGHTUSERDATA:
|
||||
|
Loading…
Reference in New Issue
Block a user