summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2018-10-14 19:25:32 +0300
committerCyrill Gorcunov <gorcunov@gmail.com>2018-10-14 19:25:32 +0300
commit980dd658b521afe4a688c4195410c4449a8e2468 (patch)
tree50bdc8d846c8c68cad592bb08763b04ac228faea
parentceec0d818798aeaa75ed4907e6135b0247ed46b2 (diff)
downloadnasm-980dd658b521afe4a688c4195410c4449a8e2468.tar.gz
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 <gorcunov@gmail.com>
-rw-r--r--asm/preproc.c4
1 files changed, 3 insertions, 1 deletions
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;