diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-03-04 11:46:35 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-03-04 11:46:35 -0300 |
commit | 6f30fa98d82a02a05040f7925a547067e29409d9 (patch) | |
tree | 1f9f683fc148818842e94cd774df380b2c6720ef | |
parent | 74102bd7168698ea7fce423009d390fdf40ecb6c (diff) | |
download | lua-6f30fa98d82a02a05040f7925a547067e29409d9.tar.gz lua-6f30fa98d82a02a05040f7925a547067e29409d9.tar.bz2 lua-6f30fa98d82a02a05040f7925a547067e29409d9.zip |
small change to avoid error on "lua_pushstring(NULL)".
-rw-r--r-- | opcode.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -3,7 +3,7 @@ | |||
3 | ** TecCGraf - PUC-Rio | 3 | ** TecCGraf - PUC-Rio |
4 | */ | 4 | */ |
5 | 5 | ||
6 | char *rcs_opcode="$Id: opcode.c,v 3.57 1996/02/12 18:32:40 roberto Exp roberto $"; | 6 | char *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 | */ |
785 | void lua_pushstring (char *s) | 785 | void 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 | /* |