mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-11-21 03:14:19 +08:00
peproc: Fix sigsevg in smacro expansion
In case if smacro is called with inapropriate number of arguments exit early. Actually we have to handle this situation more gracefully but this requires a way more efforts than two line patches (need to refactor macro expansion). https://bugzilla.nasm.us/show_bug.cgi?id=3392431 Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
c9244eaadd
commit
59ce1c67b1
@ -4430,6 +4430,16 @@ again:
|
||||
ttt->text, 0);
|
||||
ptail = &pt->next;
|
||||
ttt = ttt->next;
|
||||
if (!ttt && i > 0) {
|
||||
/*
|
||||
* FIXME: Need to handle more gracefully,
|
||||
* exiting early on agruments analysis.
|
||||
*/
|
||||
nasm_error(ERR_FATAL,
|
||||
"macro `%s' expects %d args",
|
||||
mstart->text,
|
||||
(int)paramsize[t->type - TOK_SMAC_PARAM]);
|
||||
}
|
||||
}
|
||||
tline = pcopy;
|
||||
} else if (t->type == TOK_PREPROC_Q) {
|
||||
|
Loading…
Reference in New Issue
Block a user