mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-12-03 08:41:02 +08:00
BR3414012: Make %if[n]def to handle tail spaces
In case if there a trailing spaces after expansion %if[n]def might produce a false alarms on macro id being expected. Note it also makes the constructions like bare %ifdef %endif invalid, while before they were passed well without a notice. Reported-by: KO Myung-Hun Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
d6851d4d26
commit
4c6f82f78f
@ -1910,8 +1910,8 @@ static bool if_condition(Token * tline, enum preproc_token ct)
|
||||
|
||||
case PPC_IFDEF:
|
||||
j = false; /* have we matched yet? */
|
||||
while (tline) {
|
||||
skip_white_(tline);
|
||||
skip_white_(tline);
|
||||
do {
|
||||
if (!tline || (tline->type != TOK_ID &&
|
||||
(tline->type != TOK_PREPROC_ID ||
|
||||
tline->text[1] != '$'))) {
|
||||
@ -1922,7 +1922,8 @@ static bool if_condition(Token * tline, enum preproc_token ct)
|
||||
if (smacro_defined(NULL, tline->text, 0, NULL, true))
|
||||
j = true;
|
||||
tline = tline->next;
|
||||
}
|
||||
skip_white_(tline);
|
||||
} while (tline);
|
||||
break;
|
||||
|
||||
case PPC_IFENV:
|
||||
|
Loading…
Reference in New Issue
Block a user