diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2007-02-07 15:48:52 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2007-02-07 15:48:52 -0200 |
commit | 593bfc96685bd518978d2622671412d1862881e6 (patch) | |
tree | 012c636861eebbf2c173de6ae70fea52f5cfd3e9 /lstate.h | |
parent | 850c60e81bc5959ba73ace3ab4e48a2b8f879036 (diff) | |
download | lua-593bfc96685bd518978d2622671412d1862881e6.tar.gz lua-593bfc96685bd518978d2622671412d1862881e6.tar.bz2 lua-593bfc96685bd518978d2622671412d1862881e6.zip |
should not manipulate NULL pointers (even without accessing them)
Diffstat (limited to 'lstate.h')
-rw-r--r-- | lstate.h | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.h,v 2.26 2006/08/15 19:59:20 roberto Exp roberto $ | 2 | ** $Id: lstate.h,v 2.27 2006/09/19 13:57:50 roberto Exp roberto $ |
3 | ** Global State | 3 | ** Global State |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -156,8 +156,7 @@ union GCObject { | |||
156 | #define gco2h(o) check_exp((o)->gch.tt == LUA_TTABLE, &((o)->h)) | 156 | #define gco2h(o) check_exp((o)->gch.tt == LUA_TTABLE, &((o)->h)) |
157 | #define gco2p(o) check_exp((o)->gch.tt == LUA_TPROTO, &((o)->p)) | 157 | #define gco2p(o) check_exp((o)->gch.tt == LUA_TPROTO, &((o)->p)) |
158 | #define gco2uv(o) check_exp((o)->gch.tt == LUA_TUPVAL, &((o)->uv)) | 158 | #define gco2uv(o) check_exp((o)->gch.tt == LUA_TUPVAL, &((o)->uv)) |
159 | #define ngcotouv(o) \ | 159 | #define ngcotouv(o) check_exp((o)->gch.tt == LUA_TUPVAL, &((o)->uv)) |
160 | check_exp((o) == NULL || (o)->gch.tt == LUA_TUPVAL, &((o)->uv)) | ||
161 | #define gco2th(o) check_exp((o)->gch.tt == LUA_TTHREAD, &((o)->th)) | 160 | #define gco2th(o) check_exp((o)->gch.tt == LUA_TTHREAD, &((o)->th)) |
162 | 161 | ||
163 | /* macro to convert any Lua object into a GCObject */ | 162 | /* macro to convert any Lua object into a GCObject */ |