diff options
Diffstat (limited to 'lcode.c')
| -rw-r--r-- | lcode.c | 5 |
1 files changed, 2 insertions, 3 deletions
| @@ -541,12 +541,11 @@ static void freeexps (FuncState *fs, expdesc *e1, expdesc *e2) { | |||
| 541 | ** a function can make some indices wrong. | 541 | ** a function can make some indices wrong. |
| 542 | */ | 542 | */ |
| 543 | static int addk (FuncState *fs, TValue *key, TValue *v) { | 543 | static int addk (FuncState *fs, TValue *key, TValue *v) { |
| 544 | TValue val; | ||
| 545 | lua_State *L = fs->ls->L; | 544 | lua_State *L = fs->ls->L; |
| 546 | Proto *f = fs->f; | 545 | Proto *f = fs->f; |
| 547 | int aux = luaH_get(fs->ls->h, key, &val); /* query scanner table */ | 546 | TValue val = luaH_get(fs->ls->h, key); /* query scanner table */ |
| 548 | int k, oldsize; | 547 | int k, oldsize; |
| 549 | if (aux == HOK && ttisinteger(&val)) { /* is there an index there? */ | 548 | if (ttisintegerV(val)) { /* is there an index there? */ |
| 550 | k = cast_int(ivalue(&val)); | 549 | k = cast_int(ivalue(&val)); |
| 551 | /* correct value? (warning: must distinguish floats from integers!) */ | 550 | /* correct value? (warning: must distinguish floats from integers!) */ |
| 552 | if (k < fs->nk && ttypetag(&f->k[k]) == ttypetag(v) && | 551 | if (k < fs->nk && ttypetag(&f->k[k]) == ttypetag(v) && |
