mirror of
https://github.com/netwide-assembler/nasm
synced 2026-08-26 16:23:04 -04:00
asm/preproc.c: fix NULL pointer on %exitrep outside %rep
When %exitrep incorrectly occurs outside a %rep block, do_exit_macro() returns NULL, but the %exitrep code would try to set m->in_progress = 1 anyway, causing a NULL pointer dereference and crashing NASM. Add a NULL pointer guard around this assignment; an error has already been issued. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
parent
d7c7de072f
commit
c8ea2d906d
1 changed files with 2 additions and 1 deletions
|
|
@ -5204,7 +5204,8 @@ static int do_directive(Token *tline, Token **output, bool suppressed)
|
|||
case PP_EXITREP:
|
||||
{
|
||||
MMacro *m = do_exit_macro(dname, false);
|
||||
m->in_progress = 1; /* No more repeats */
|
||||
if (m)
|
||||
m->in_progress = 1; /* No more repeats */
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue