From f360e7778bb7e4be6afc4e27bd9412222b2c6c55 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 22 Dec 2017 14:43:59 -0200 Subject: assert cannot use instruction after the last --- lcode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lcode.c') diff --git a/lcode.c b/lcode.c index 521f597a..1eae475a 100644 --- a/lcode.c +++ b/lcode.c @@ -1,5 +1,5 @@ /* -** $Id: lcode.c,v 2.146 2017/12/18 15:44:44 roberto Exp roberto $ +** $Id: lcode.c,v 2.147 2017/12/22 14:16:46 roberto Exp roberto $ ** Code generator for Lua ** See Copyright Notice in lua.h */ @@ -1622,7 +1622,7 @@ void luaK_finish (FuncState *fs) { Proto *p = fs->f; for (i = 0; i < fs->pc; i++) { Instruction *pc = &p->code[i]; - lua_assert(isOT(*pc) == isIT(*(pc + 1))); + lua_assert(i == 0 || isOT(*(pc - 1)) == isIT(*pc)); switch (GET_OPCODE(*pc)) { case OP_RETURN: case OP_RETURN0: case OP_RETURN1: case OP_TAILCALL: { -- cgit v1.2.3-55-g6feb