lua

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

commit 6f30fa98d82a02a05040f7925a547067e29409d9
parent 74102bd7168698ea7fce423009d390fdf40ecb6c
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Mon,  4 Mar 1996 11:46:15 -0300

small change to avoid error on "lua_pushstring(NULL)".

Diffstat:
Mopcode.c | 13+++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/opcode.c b/opcode.c @@ -3,7 +3,7 @@ ** TecCGraf - PUC-Rio */ -char *rcs_opcode="$Id: opcode.c,v 3.57 1996/02/12 18:32:40 roberto Exp roberto $"; +char *rcs_opcode="$Id: opcode.c,v 3.58 1996/02/22 20:34:33 roberto Exp roberto $"; #include <setjmp.h> #include <stdlib.h> @@ -784,9 +784,14 @@ void lua_pushnumber (real n) */ void lua_pushstring (char *s) { - tsvalue(top) = lua_createstring(s); - tag(top) = LUA_T_STRING; - incr_top; + if (s == NULL) + tag(top) = LUA_T_NIL; + else + { + tsvalue(top) = lua_createstring(s); + tag(top) = LUA_T_STRING; + } + incr_top; } /*