diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-07-11 11:01:28 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-07-11 11:01:28 -0300 |
commit | e86dab2daec444580485dcdba5f3f68d1474dad5 (patch) | |
tree | 768f0da1a74874f9c6ef398c968ec60750931b2f | |
parent | 64b57db377d9c08ee0f25997559462c2a3507f32 (diff) | |
download | lua-e86dab2daec444580485dcdba5f3f68d1474dad5.tar.gz lua-e86dab2daec444580485dcdba5f3f68d1474dad5.tar.bz2 lua-e86dab2daec444580485dcdba5f3f68d1474dad5.zip |
details
-rw-r--r-- | lauxlib.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lauxlib.c,v 1.136 2005/05/31 14:31:50 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.137 2005/05/31 14:34:02 roberto Exp roberto $ |
3 | ** Auxiliary functions for building Lua libraries | 3 | ** Auxiliary functions for building Lua libraries |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -682,14 +682,15 @@ static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { | |||
682 | 682 | ||
683 | static int panic (lua_State *L) { | 683 | static int panic (lua_State *L) { |
684 | (void)L; /* to avoid warnings */ | 684 | (void)L; /* to avoid warnings */ |
685 | fprintf(stderr, "PANIC: unprotected error during Lua-API call\n"); | 685 | fprintf(stderr, "PANIC: unprotected error during Lua-API call (%s)\n", |
686 | lua_tostring(L, -1)); | ||
686 | return 0; | 687 | return 0; |
687 | } | 688 | } |
688 | 689 | ||
689 | 690 | ||
690 | LUALIB_API lua_State *luaL_newstate (void) { | 691 | LUALIB_API lua_State *luaL_newstate (void) { |
691 | lua_State *L = lua_newstate(l_alloc, NULL); | 692 | lua_State *L = lua_newstate(l_alloc, NULL); |
692 | lua_atpanic(L, &panic); | 693 | if (L) lua_atpanic(L, &panic); |
693 | return L; | 694 | return L; |
694 | } | 695 | } |
695 | 696 | ||