From 980dd658b521afe4a688c4195410c4449a8e2468 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Sun, 14 Oct 2018 19:25:32 +0300 Subject: [PATCH] preproc: expand_smacro -- Fix nil dereference on error path When error happened earlier we might have a.mac already handled and set to nil. https://bugzilla.nasm.us/show_bug.cgi?id=3392508 Signed-off-by: Cyrill Gorcunov --- asm/preproc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/asm/preproc.c b/asm/preproc.c index 0ceb2434..cdf03bc1 100644 --- a/asm/preproc.c +++ b/asm/preproc.c @@ -4473,7 +4473,9 @@ again: } if (tline->type == TOK_SMAC_END) { - tline->a.mac->in_progress = false; + /* On error path it might already be dropped */ + if (tline->a.mac) + tline->a.mac->in_progress = false; tline = delete_Token(tline); } else { t = *tail = tline; -- 2.11.4.GIT