From ae5b5ba529753c7a653901ffc29b5ea24c3fdf3a Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 27 Jul 2020 13:23:05 -0300 Subject: Fixed bug: line hooks in stripped functions Line-hook handling was accessing debug info. without checking whether it was present. --- ldebug.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ldebug.c') diff --git a/ldebug.c b/ldebug.c index 9ff7edeb..8cb00e51 100644 --- a/ldebug.c +++ b/ldebug.c @@ -783,11 +783,13 @@ l_noret luaG_runerror (lua_State *L, const char *fmt, ...) { ** previous instruction 'oldpc'. */ static int changedline (const Proto *p, int oldpc, int newpc) { + if (p->lineinfo == NULL) /* no debug information? */ + return 0; while (oldpc++ < newpc) { if (p->lineinfo[oldpc] != 0) return (luaG_getfuncline(p, oldpc - 1) != luaG_getfuncline(p, newpc)); } - return 0; /* no line changes in the way */ + return 0; /* no line changes between positions */ } -- cgit v1.2.3-55-g6feb