mirror of
https://github.com/lua/lua
synced 2026-09-27 00:28:25 +03:00
Small issue in 'exprstat'
The code should not compute an instruction address before checking that it exists. (Virtually no machine complains of computing an invalid address, as long as the address is not used, but for ISO C that is undefined behavior.)
This commit is contained in:
parent
9e0a8475cd
commit
cac075a122
1 changed files with 2 additions and 1 deletions
|
|
@ -1822,8 +1822,9 @@ static void exprstat (LexState *ls) {
|
|||
restassign(ls, &v, 1);
|
||||
}
|
||||
else { /* stat -> func */
|
||||
Instruction *inst = &getinstruction(fs, &v.v);
|
||||
Instruction *inst;
|
||||
check_condition(ls, v.v.k == VCALL, "syntax error");
|
||||
inst = &getinstruction(fs, &v.v);
|
||||
SETARG_C(*inst, 1); /* call statement uses no results */
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue