diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-23 12:32:00 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-23 12:32:00 -0200 |
commit | d490555ec9d5efb886211f735694d4e7dd0c166d (patch) | |
tree | f9b75cdc3a6d4132dddc884280ae218a7f9beb5c /opcode.c | |
parent | ad0ec203f60df5e2f8a3b294c9e8c1014280b8f1 (diff) | |
download | lua-d490555ec9d5efb886211f735694d4e7dd0c166d.tar.gz lua-d490555ec9d5efb886211f735694d4e7dd0c166d.tar.bz2 lua-d490555ec9d5efb886211f735694d4e7dd0c166d.zip |
garbage collection tag for strings organized in struct TaggedString
Diffstat (limited to 'opcode.c')
-rw-r--r-- | opcode.c | 14 |
1 files changed, 7 insertions, 7 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.20 1994/11/21 18:22:58 roberto Exp roberto $"; | 6 | char *rcs_opcode="$Id: opcode.c,v 3.21 1994/11/22 16:02:53 roberto Exp roberto $"; |
7 | 7 | ||
8 | #include <setjmp.h> | 8 | #include <setjmp.h> |
9 | #include <stdio.h> | 9 | #include <stdio.h> |
@@ -165,8 +165,8 @@ static int lua_tostring (Object *obj) | |||
165 | sprintf (s, "%d", (int) nvalue(obj)); | 165 | sprintf (s, "%d", (int) nvalue(obj)); |
166 | else | 166 | else |
167 | sprintf (s, "%g", nvalue(obj)); | 167 | sprintf (s, "%g", nvalue(obj)); |
168 | svalue(obj) = lua_createstring(s); | 168 | tsvalue(obj) = lua_createstring(s); |
169 | if (svalue(obj) == NULL) | 169 | if (tsvalue(obj) == NULL) |
170 | return 1; | 170 | return 1; |
171 | tag(obj) = LUA_T_STRING; | 171 | tag(obj) = LUA_T_STRING; |
172 | return 0; | 172 | return 0; |
@@ -637,7 +637,7 @@ int lua_pushnumber (real n) | |||
637 | int lua_pushstring (char *s) | 637 | int lua_pushstring (char *s) |
638 | { | 638 | { |
639 | lua_checkstack(top-stack+1); | 639 | lua_checkstack(top-stack+1); |
640 | svalue(top) = lua_createstring(s); | 640 | tsvalue(top) = lua_createstring(s); |
641 | tag(top) = LUA_T_STRING; | 641 | tag(top) = LUA_T_STRING; |
642 | top++; | 642 | top++; |
643 | return 0; | 643 | return 0; |
@@ -770,7 +770,7 @@ static int lua_execute (Byte *pc, int base) | |||
770 | { | 770 | { |
771 | CodeWord code; | 771 | CodeWord code; |
772 | get_word(code,pc); | 772 | get_word(code,pc); |
773 | tag(top) = LUA_T_STRING; svalue(top++) = lua_constant[code.w]; | 773 | tag(top) = LUA_T_STRING; tsvalue(top++) = lua_constant[code.w]; |
774 | } | 774 | } |
775 | break; | 775 | break; |
776 | 776 | ||
@@ -877,7 +877,7 @@ static int lua_execute (Byte *pc, int base) | |||
877 | { | 877 | { |
878 | CodeWord code; | 878 | CodeWord code; |
879 | get_word(code,pc); | 879 | get_word(code,pc); |
880 | tag(top) = LUA_T_STRING; svalue(top) = lua_constant[code.w]; | 880 | tag(top) = LUA_T_STRING; tsvalue(top) = lua_constant[code.w]; |
881 | *(lua_hashdefine (avalue(arr), top)) = *(top-1); | 881 | *(lua_hashdefine (avalue(arr), top)) = *(top-1); |
882 | top--; | 882 | top--; |
883 | n--; | 883 | n--; |
@@ -996,7 +996,7 @@ static int lua_execute (Byte *pc, int base) | |||
996 | do_call(&luaI_fallBacks[FB_CONCAT].function, (top-stack)-2, 1, (top-stack)-2); | 996 | do_call(&luaI_fallBacks[FB_CONCAT].function, (top-stack)-2, 1, (top-stack)-2); |
997 | else | 997 | else |
998 | { | 998 | { |
999 | svalue(l) = lua_createstring (lua_strconc(svalue(l),svalue(r))); | 999 | tsvalue(l) = lua_createstring (lua_strconc(svalue(l),svalue(r))); |
1000 | --top; | 1000 | --top; |
1001 | } | 1001 | } |
1002 | } | 1002 | } |