diff options
Diffstat (limited to 'lcode.c')
-rw-r--r-- | lcode.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1317,22 +1317,22 @@ void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) { | |||
1317 | lu_byte temp = cast_byte(t->u.info); /* upvalue index */ | 1317 | lu_byte temp = cast_byte(t->u.info); /* upvalue index */ |
1318 | t->u.ind.t = temp; /* (can't do a direct assignment; values overlap) */ | 1318 | t->u.ind.t = temp; /* (can't do a direct assignment; values overlap) */ |
1319 | lua_assert(isKstr(fs, k)); | 1319 | lua_assert(isKstr(fs, k)); |
1320 | t->u.ind.idx = cast(short, k->u.info); /* literal short string */ | 1320 | t->u.ind.idx = cast_short(k->u.info); /* literal short string */ |
1321 | t->k = VINDEXUP; | 1321 | t->k = VINDEXUP; |
1322 | } | 1322 | } |
1323 | else { | 1323 | else { |
1324 | /* register index of the table */ | 1324 | /* register index of the table */ |
1325 | t->u.ind.t = cast_byte((t->k == VLOCAL) ? t->u.var.ridx: t->u.info); | 1325 | t->u.ind.t = cast_byte((t->k == VLOCAL) ? t->u.var.ridx: t->u.info); |
1326 | if (isKstr(fs, k)) { | 1326 | if (isKstr(fs, k)) { |
1327 | t->u.ind.idx = cast(short, k->u.info); /* literal short string */ | 1327 | t->u.ind.idx = cast_short(k->u.info); /* literal short string */ |
1328 | t->k = VINDEXSTR; | 1328 | t->k = VINDEXSTR; |
1329 | } | 1329 | } |
1330 | else if (isCint(k)) { /* int. constant in proper range? */ | 1330 | else if (isCint(k)) { /* int. constant in proper range? */ |
1331 | t->u.ind.idx = cast(short, k->u.ival); | 1331 | t->u.ind.idx = cast_short(k->u.ival); |
1332 | t->k = VINDEXI; | 1332 | t->k = VINDEXI; |
1333 | } | 1333 | } |
1334 | else { | 1334 | else { |
1335 | t->u.ind.idx = cast(short, luaK_exp2anyreg(fs, k)); /* register */ | 1335 | t->u.ind.idx = cast_short(luaK_exp2anyreg(fs, k)); /* register */ |
1336 | t->k = VINDEXED; | 1336 | t->k = VINDEXED; |
1337 | } | 1337 | } |
1338 | } | 1338 | } |