diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1995-12-18 14:47:29 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1995-12-18 14:47:29 -0200 |
| commit | 415ee250b5b544c91157a037a1e3c4a8f0b6cc4c (patch) | |
| tree | 3d0694f50b2e613ad2ae0dd44fe28c24c99f1a2f | |
| parent | f188e1000ba939dd58de2e8bdfa49db2e8db571c (diff) | |
| download | lua-415ee250b5b544c91157a037a1e3c4a8f0b6cc4c.tar.gz lua-415ee250b5b544c91157a037a1e3c4a8f0b6cc4c.tar.bz2 lua-415ee250b5b544c91157a037a1e3c4a8f0b6cc4c.zip | |
bug: luaI_findconstantbyname may change the value of lua_constant.
| -rw-r--r-- | opcode.c | 5 |
1 files changed, 3 insertions, 2 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.49 1995/11/10 14:12:02 roberto Exp roberto $"; | 6 | char *rcs_opcode="$Id: opcode.c,v 3.50 1995/11/16 20:46:24 roberto Exp roberto $"; |
| 7 | 7 | ||
| 8 | #include <setjmp.h> | 8 | #include <setjmp.h> |
| 9 | #include <stdlib.h> | 9 | #include <stdlib.h> |
| @@ -688,7 +688,8 @@ void lua_pushstring (char *s) | |||
| 688 | */ | 688 | */ |
| 689 | void lua_pushliteral (char *s) | 689 | void lua_pushliteral (char *s) |
| 690 | { | 690 | { |
| 691 | tsvalue(top) = lua_constant[luaI_findconstantbyname(s)]; | 691 | Word ct = luaI_findconstantbyname(s); /* this call may change lua_constant */ |
| 692 | tsvalue(top) = lua_constant[ct]; | ||
| 692 | tag(top) = LUA_T_STRING; | 693 | tag(top) = LUA_T_STRING; |
| 693 | incr_top; | 694 | incr_top; |
| 694 | } | 695 | } |
