aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-03-04 11:46:35 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-03-04 11:46:35 -0300
commit6f30fa98d82a02a05040f7925a547067e29409d9 (patch)
tree1f9f683fc148818842e94cd774df380b2c6720ef
parent74102bd7168698ea7fce423009d390fdf40ecb6c (diff)
downloadlua-6f30fa98d82a02a05040f7925a547067e29409d9.tar.gz
lua-6f30fa98d82a02a05040f7925a547067e29409d9.tar.bz2
lua-6f30fa98d82a02a05040f7925a547067e29409d9.zip
small change to avoid error on "lua_pushstring(NULL)".
-rw-r--r--opcode.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/opcode.c b/opcode.c
index c11cda3f..d6b9830a 100644
--- a/opcode.c
+++ b/opcode.c
@@ -3,7 +3,7 @@
3** TecCGraf - PUC-Rio 3** TecCGraf - PUC-Rio
4*/ 4*/
5 5
6char *rcs_opcode="$Id: opcode.c,v 3.57 1996/02/12 18:32:40 roberto Exp roberto $"; 6char *rcs_opcode="$Id: opcode.c,v 3.58 1996/02/22 20:34:33 roberto Exp roberto $";
7 7
8#include <setjmp.h> 8#include <setjmp.h>
9#include <stdlib.h> 9#include <stdlib.h>
@@ -784,9 +784,14 @@ void lua_pushnumber (real n)
784*/ 784*/
785void lua_pushstring (char *s) 785void lua_pushstring (char *s)
786{ 786{
787 tsvalue(top) = lua_createstring(s); 787 if (s == NULL)
788 tag(top) = LUA_T_STRING; 788 tag(top) = LUA_T_NIL;
789 incr_top; 789 else
790 {
791 tsvalue(top) = lua_createstring(s);
792 tag(top) = LUA_T_STRING;
793 }
794 incr_top;
790} 795}
791 796
792/* 797/*