diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-08-04 16:38:35 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-08-04 16:38:35 -0300 |
| commit | 435f587ed05e2c4d542e1db9ae9e4efbb7e02305 (patch) | |
| tree | 1b179bf836cfdaf8ed74df24c2d22cda8f07aaa9 /lbuiltin.c | |
| parent | ae55f3eeada102f3fa8345173410feaf1db42cde (diff) | |
| download | lua-435f587ed05e2c4d542e1db9ae9e4efbb7e02305.tar.gz lua-435f587ed05e2c4d542e1db9ae9e4efbb7e02305.tar.bz2 lua-435f587ed05e2c4d542e1db9ae9e4efbb7e02305.zip | |
(much) better handling of memory alloction errors
Diffstat (limited to 'lbuiltin.c')
| -rw-r--r-- | lbuiltin.c | 8 |
1 files changed, 3 insertions, 5 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lbuiltin.c,v 1.116 2000/06/12 13:52:05 roberto Exp roberto $ | 2 | ** $Id: lbuiltin.c,v 1.117 2000/06/30 14:35:17 roberto Exp roberto $ |
| 3 | ** Built-in functions | 3 | ** Built-in functions |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -365,8 +365,8 @@ void luaB_tostring (lua_State *L) { | |||
| 365 | sprintf(buff, "function: %p", clvalue(o)); | 365 | sprintf(buff, "function: %p", clvalue(o)); |
| 366 | break; | 366 | break; |
| 367 | case TAG_USERDATA: | 367 | case TAG_USERDATA: |
| 368 | sprintf(buff, "userdata: %p(%d)", tsvalue(o)->u.d.value, | 368 | sprintf(buff, "userdata(%d): %p", tsvalue(o)->u.d.tag, |
| 369 | tsvalue(o)->u.d.tag); | 369 | tsvalue(o)->u.d.value); |
| 370 | break; | 370 | break; |
| 371 | case TAG_NIL: | 371 | case TAG_NIL: |
| 372 | lua_pushstring(L, "nil"); | 372 | lua_pushstring(L, "nil"); |
| @@ -680,8 +680,6 @@ static const struct luaL_reg builtin_funcs[] = { | |||
| 680 | 680 | ||
| 681 | 681 | ||
| 682 | void luaB_predefine (lua_State *L) { | 682 | void luaB_predefine (lua_State *L) { |
| 683 | /* pre-register mem error messages, to avoid loop when error arises */ | ||
| 684 | luaS_newfixed(L, memEM); | ||
| 685 | luaL_openl(L, builtin_funcs); | 683 | luaL_openl(L, builtin_funcs); |
| 686 | #ifdef DEBUG | 684 | #ifdef DEBUG |
| 687 | luaB_opentests(L); /* internal test functions */ | 685 | luaB_opentests(L); /* internal test functions */ |
