diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-07-27 13:23:05 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-07-27 13:23:05 -0300 |
commit | ae5b5ba529753c7a653901ffc29b5ea24c3fdf3a (patch) | |
tree | 7b1978d77887e38b486accaf7412cc84668e4560 /ldebug.c | |
parent | a585eae6e7ada1ca9271607a4f48dfb17868ab7b (diff) | |
download | lua-ae5b5ba529753c7a653901ffc29b5ea24c3fdf3a.tar.gz lua-ae5b5ba529753c7a653901ffc29b5ea24c3fdf3a.tar.bz2 lua-ae5b5ba529753c7a653901ffc29b5ea24c3fdf3a.zip |
Fixed bug: line hooks in stripped functions
Line-hook handling was accessing debug info. without checking whether
it was present.
Diffstat (limited to 'ldebug.c')
-rw-r--r-- | ldebug.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -783,11 +783,13 @@ l_noret luaG_runerror (lua_State *L, const char *fmt, ...) { | |||
783 | ** previous instruction 'oldpc'. | 783 | ** previous instruction 'oldpc'. |
784 | */ | 784 | */ |
785 | static int changedline (const Proto *p, int oldpc, int newpc) { | 785 | static int changedline (const Proto *p, int oldpc, int newpc) { |
786 | if (p->lineinfo == NULL) /* no debug information? */ | ||
787 | return 0; | ||
786 | while (oldpc++ < newpc) { | 788 | while (oldpc++ < newpc) { |
787 | if (p->lineinfo[oldpc] != 0) | 789 | if (p->lineinfo[oldpc] != 0) |
788 | return (luaG_getfuncline(p, oldpc - 1) != luaG_getfuncline(p, newpc)); | 790 | return (luaG_getfuncline(p, oldpc - 1) != luaG_getfuncline(p, newpc)); |
789 | } | 791 | } |
790 | return 0; /* no line changes in the way */ | 792 | return 0; /* no line changes between positions */ |
791 | } | 793 | } |
792 | 794 | ||
793 | 795 | ||