lua

A copy of the Lua development repository
Log | Files | Refs | README

commit e86dab2daec444580485dcdba5f3f68d1474dad5
parent 64b57db377d9c08ee0f25997559462c2a3507f32
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Mon, 11 Jul 2005 11:01:06 -0300

details

Diffstat:
Mlauxlib.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lauxlib.c b/lauxlib.c @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.c,v 1.136 2005/05/31 14:31:50 roberto Exp roberto $ +** $Id: lauxlib.c,v 1.137 2005/05/31 14:34:02 roberto Exp roberto $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ @@ -682,14 +682,15 @@ static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { static int panic (lua_State *L) { (void)L; /* to avoid warnings */ - fprintf(stderr, "PANIC: unprotected error during Lua-API call\n"); + fprintf(stderr, "PANIC: unprotected error during Lua-API call (%s)\n", + lua_tostring(L, -1)); return 0; } LUALIB_API lua_State *luaL_newstate (void) { lua_State *L = lua_newstate(l_alloc, NULL); - lua_atpanic(L, &panic); + if (L) lua_atpanic(L, &panic); return L; }