1
0
mirror of https://github.com/lua/lua synced 2026-06-08 15:34:49 +00:00

Cleaning 'luaP_isIT' and 'luaP_isOT'

- 'luaP_isOT' is only used for tests, so it is defined as a macro to avoid
wasting space with an unused function.
- 'luaP_isIT' must include OP_VARARGPREP.
This commit is contained in:
Roberto I
2026-05-28 15:10:17 -03:00
parent 53b41d0cdd
commit 0465c23b3e
3 changed files with 17 additions and 23 deletions
-2
View File
@@ -1934,8 +1934,6 @@ void luaK_finish (FuncState *fs) {
p->flag &= cast_byte(~PF_VAHID); /* then it will not use hidden args. */
for (i = 0; i < fs->pc; i++) {
Instruction *pc = &p->code[i];
/* avoid "not used" warnings when assert is off (for 'onelua.c') */
(void)luaP_isOT; (void)luaP_isIT;
lua_assert(i == 0 || luaP_isOT(*(pc - 1)) == luaP_isIT(*pc));
switch (GET_OPCODE(*pc)) {
case OP_RETURN0: case OP_RETURN1: {