diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2010-10-07 19:30:54 +0400 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2010-10-07 19:42:12 +0400 |
commit | e0fdd77584b22afc319e7ae22649d48e7668ad86 (patch) | |
tree | 361026aed5a9f2f83acc264e1881e24e6033e676 /preproc.c | |
parent | 51296252257e99edbfaad0174017a14e5fbf370b (diff) | |
download | nasm-e0fdd77584b22afc319e7ae22649d48e7668ad86.tar.gz nasm-e0fdd77584b22afc319e7ae22649d48e7668ad86.tar.bz2 nasm-e0fdd77584b22afc319e7ae22649d48e7668ad86.zip |
preproc: Issue warning on unterminated %{ construct
As being pointed by "matching braces" topic on
[ http://forum.nasm.us/index.php?topic=905.0 ]
we don't issue warning on missed match for "{"
brace opened.
Strictly speaking we should issue error instead and
force user to fix asm source code but since it's
here for a long time already -- lets be "admissive".
Reported-by: Klod
CC: Frank Kotler <fbkotler@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'preproc.c')
-rw-r--r-- | preproc.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -914,10 +914,14 @@ static Token *tokenize(char *line) type = TOK_PREPROC_ID; } else if (*p == '{') { p++; - while (*p && *p != '}') { + while (*p) { + if (*p == '}') + break; p[-1] = *p; p++; } + if (*p != '}') + error(ERR_WARNING | ERR_PASS1, "unterminated %{ construct"); p[-1] = '\0'; if (*p) p++; |