diff options
Diffstat (limited to 'lapi.c')
| -rw-r--r-- | lapi.c | 4 |
1 files changed, 3 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lapi.c,v 1.18 1998/01/07 16:26:48 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 1.19 1998/01/09 14:44:55 roberto Exp roberto $ |
| 3 | ** Lua API | 3 | ** Lua API |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -287,6 +287,7 @@ double lua_getnumber (lua_Object object) | |||
| 287 | 287 | ||
| 288 | char *lua_getstring (lua_Object object) | 288 | char *lua_getstring (lua_Object object) |
| 289 | { | 289 | { |
| 290 | luaC_checkGC(); /* "tostring" may create a new string */ | ||
| 290 | if (object == LUA_NOOBJECT || tostring(Address(object))) | 291 | if (object == LUA_NOOBJECT || tostring(Address(object))) |
| 291 | return NULL; | 292 | return NULL; |
| 292 | else return (svalue(Address(object))); | 293 | else return (svalue(Address(object))); |
| @@ -341,6 +342,7 @@ void lua_pushCclosure (lua_CFunction fn, int n) | |||
| 341 | fvalue(L->stack.top) = fn; | 342 | fvalue(L->stack.top) = fn; |
| 342 | incr_top; | 343 | incr_top; |
| 343 | luaV_closure(n); | 344 | luaV_closure(n); |
| 345 | luaC_checkGC(); | ||
| 344 | } | 346 | } |
| 345 | 347 | ||
| 346 | void lua_pushusertag (void *u, int tag) | 348 | void lua_pushusertag (void *u, int tag) |
