preproc: Workaround a usage after free bug

In some circumstantes this free is incorrect resulting
in usage after-free. Workaround it by not freeing memory
here.

https://bugzilla.nasm.us/show_bug.cgi?id=3392414

gorcunov@:
 - slightly tuneup the comment

Signed-off-by: Adam Majer <amajer@suse.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
Adam Majer 2017-07-25 10:42:01 +02:00 committed by Cyrill Gorcunov
parent f9ec5bbd2a
commit 736be08cf3

View file

@ -5101,8 +5101,18 @@ static char *pp_getline(void)
nasm_free(m->paramlen);
l->finishes->in_progress = 0;
}
} else
}
/*
* FIXME It is incorrect to always free_mmacro here.
* It leads to usage-after-free.
*
* https://bugzilla.nasm.us/show_bug.cgi?id=3392414
*/
#if 0
else
free_mmacro(m);
#endif
}
istk->expansion = l->next;
nasm_free(l);