diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-08-22 17:53:30 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-08-22 17:53:30 -0300 |
| commit | 3723d790ae941dbbdb7f97484f9f2512264c54a6 (patch) | |
| tree | 147aeef3f40ac938be5a611c35a21c52adf5be4d | |
| parent | b800c38b6920863725a279332f001bce1d457020 (diff) | |
| download | lua-3723d790ae941dbbdb7f97484f9f2512264c54a6.tar.gz lua-3723d790ae941dbbdb7f97484f9f2512264c54a6.tar.bz2 lua-3723d790ae941dbbdb7f97484f9f2512264c54a6.zip | |
checkstack needs a correct stack
| -rw-r--r-- | lvm.c | 4 |
1 files changed, 3 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lvm.c,v 1.127 2000/08/14 14:05:06 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 1.128 2000/08/22 20:49:29 roberto Exp roberto $ |
| 3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -176,6 +176,7 @@ void luaV_getglobal (lua_State *L, TString *s, StkId top) { | |||
| 176 | if (ttype(im) == TAG_NIL) /* is there a tag method? */ | 176 | if (ttype(im) == TAG_NIL) /* is there a tag method? */ |
| 177 | *top = *value; /* default behavior */ | 177 | *top = *value; /* default behavior */ |
| 178 | else { /* tag method */ | 178 | else { /* tag method */ |
| 179 | L->top = top; | ||
| 179 | luaD_checkstack(L, 3); | 180 | luaD_checkstack(L, 3); |
| 180 | *top = *im; | 181 | *top = *im; |
| 181 | ttype(top+1) = TAG_STRING; | 182 | ttype(top+1) = TAG_STRING; |
| @@ -203,6 +204,7 @@ void luaV_setglobal (lua_State *L, TString *s, StkId top) { | |||
| 203 | } | 204 | } |
| 204 | } | 205 | } |
| 205 | else { | 206 | else { |
| 207 | L->top = top; | ||
| 206 | luaD_checkstack(L, 3); | 208 | luaD_checkstack(L, 3); |
| 207 | *(top+2) = *(top-1); /* new value */ | 209 | *(top+2) = *(top-1); /* new value */ |
| 208 | *(top+1) = *oldvalue; | 210 | *(top+1) = *oldvalue; |
