diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-05-15 16:30:41 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-05-15 16:30:41 -0300 |
| commit | 9e1f94fc1c3e8d4a8e68185223d03dafc1ee8050 (patch) | |
| tree | dfafa45731ad97e75b8e480342747788aeb7f843 | |
| parent | 8714cc02d6367039d3d76279f024d30326371277 (diff) | |
| download | lua-9e1f94fc1c3e8d4a8e68185223d03dafc1ee8050.tar.gz lua-9e1f94fc1c3e8d4a8e68185223d03dafc1ee8050.tar.bz2 lua-9e1f94fc1c3e8d4a8e68185223d03dafc1ee8050.zip | |
cannot change value of private locals (used to implement `for')
| -rw-r--r-- | ldebug.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldebug.c,v 1.18 2000/05/08 20:49:05 roberto Exp roberto $ | 2 | ** $Id: ldebug.c,v 1.19 2000/05/12 19:49:18 roberto Exp roberto $ |
| 3 | ** Debug Interface | 3 | ** Debug Interface |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -125,7 +125,7 @@ int lua_setlocal (lua_State *L, const lua_Debug *ar, lua_Localvar *v) { | |||
| 125 | Proto *fp = getluaproto(f); | 125 | Proto *fp = getluaproto(f); |
| 126 | if (!fp) return 0; /* `f' is not a Lua function? */ | 126 | if (!fp) return 0; /* `f' is not a Lua function? */ |
| 127 | v->name = luaF_getlocalname(fp, v->index, lua_currentline(L, f)); | 127 | v->name = luaF_getlocalname(fp, v->index, lua_currentline(L, f)); |
| 128 | if (!v->name) return 0; | 128 | if (!v->name || v->name[0] == '*') return 0; /* `*' starts private locals */ |
| 129 | LUA_ASSERT(L, ttype(f+1) == TAG_LINE, ""); | 129 | LUA_ASSERT(L, ttype(f+1) == TAG_LINE, ""); |
| 130 | *((f+2)+(v->index-1)) = *v->value; | 130 | *((f+2)+(v->index-1)) = *v->value; |
| 131 | return 1; | 131 | return 1; |
