mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-04-12 18:40:23 +08:00
preproc: when parsing an smacro template, don't mistake , for )
The operation of the ',' and ')' tokens are very similar, except for: ',' issues a error if the processed parameter is greedy; ')' sets the "done" variable. The code would incorrectly set "done" for a ',' token. This fixes travis test br3392711. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
parent
6bd975476f
commit
dab902cbdc
@ -2963,8 +2963,11 @@ static int parse_smacro_template(Token ***tpp, SMacro *tmpl)
|
||||
case ',':
|
||||
if (greedy)
|
||||
nasm_nonfatal("greedy parameter must be last");
|
||||
/* fall through */
|
||||
goto end_param;
|
||||
case ')':
|
||||
done = true;
|
||||
goto end_param;
|
||||
end_param:
|
||||
if (params) {
|
||||
if (name)
|
||||
steal_Token(¶ms[nparam].name, name);
|
||||
@ -2973,7 +2976,6 @@ static int parse_smacro_template(Token ***tpp, SMacro *tmpl)
|
||||
nparam++;
|
||||
name = NULL;
|
||||
flags = 0;
|
||||
done = true;
|
||||
break;
|
||||
case TOKEN_WHITESPACE:
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user