| 469 |
} |
} |
| 470 |
|
|
| 471 |
|
|
| 472 |
void luaK_storevar (FuncState *fs, expdesc *var, expdesc *ex) { |
void luaK_storevar (FuncState *fs, expdesc *var, expdesc *ex, BinOpr opr) { |
| 473 |
|
expdesc tempvar; |
| 474 |
|
|
| 475 |
|
if (opr != OPR_NOBINOPR) { |
| 476 |
|
tempvar = *var; |
| 477 |
|
|
| 478 |
|
if (var->k == VINDEXED) { |
| 479 |
|
/* soft discharge to keep the var available */ |
| 480 |
|
tempvar.u.s.info = luaK_codeABC(fs, OP_GETTABLE, 0, var->u.s.info, var->u.s.aux); |
| 481 |
|
tempvar.k = VRELOCABLE; |
| 482 |
|
} |
| 483 |
|
|
| 484 |
|
if (opr == OPR_CONCAT) { |
| 485 |
|
/* reorient the stack so the operand is on top */ |
| 486 |
|
luaK_reserveregs(fs, 2); |
| 487 |
|
exp2reg(fs, ex, fs->freereg-1); |
| 488 |
|
exp2reg(fs, &tempvar, fs->freereg-2); |
| 489 |
|
} |
| 490 |
|
luaK_posfix(fs, opr, &tempvar, ex); |
| 491 |
|
ex = &tempvar; |
| 492 |
|
} |
| 493 |
|
|
| 494 |
switch (var->k) { |
switch (var->k) { |
| 495 |
case VLOCAL: { |
case VLOCAL: { |
| 496 |
freeexp(fs, ex); |
freeexp(fs, ex); |