diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-06-15 17:36:57 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-06-15 17:36:57 -0300 |
| commit | 8e586c13fcf3066886a7edd69011304eaad57a2b (patch) | |
| tree | 417c2102ba8c4d693c49a2df839612d371eded50 /lcode.c | |
| parent | eadf2aaaffa7a35e7f67b150ce0d57f2c17b9231 (diff) | |
| download | lua-8e586c13fcf3066886a7edd69011304eaad57a2b.tar.gz lua-8e586c13fcf3066886a7edd69011304eaad57a2b.tar.bz2 lua-8e586c13fcf3066886a7edd69011304eaad57a2b.zip | |
cleaner way to ensure alignment for strings and userdata
Diffstat (limited to 'lcode.c')
| -rw-r--r-- | lcode.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lcode.c,v 1.74 2001/06/11 14:56:42 roberto Exp roberto $ | 2 | ** $Id: lcode.c,v 1.75 2001/06/12 14:36:48 roberto Exp roberto $ |
| 3 | ** Code generator for Lua | 3 | ** Code generator for Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -232,12 +232,12 @@ static int addk (FuncState *fs, TObject *k) { | |||
| 232 | 232 | ||
| 233 | int luaK_stringk (FuncState *fs, TString *s) { | 233 | int luaK_stringk (FuncState *fs, TString *s) { |
| 234 | Proto *f = fs->f; | 234 | Proto *f = fs->f; |
| 235 | int c = s->constindex; | 235 | int c = s->tsv.constindex; |
| 236 | if (c >= fs->nk || ttype(&f->k[c]) != LUA_TSTRING || tsvalue(&f->k[c]) != s) { | 236 | if (c >= fs->nk || ttype(&f->k[c]) != LUA_TSTRING || tsvalue(&f->k[c]) != s) { |
| 237 | TObject o; | 237 | TObject o; |
| 238 | setsvalue(&o, s); | 238 | setsvalue(&o, s); |
| 239 | c = addk(fs, &o); | 239 | c = addk(fs, &o); |
| 240 | s->constindex = (unsigned short)c; /* hint for next time */ | 240 | s->tsv.constindex = (unsigned short)c; /* hint for next time */ |
| 241 | } | 241 | } |
| 242 | return c; | 242 | return c; |
| 243 | } | 243 | } |
