summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2015-02-08 11:07:17 +0300
committerCyrill Gorcunov <gorcunov@gmail.com>2015-02-08 11:07:17 +0300
commit6d42e9ba4730dc8472e4ec698e2af549c53861c3 (patch)
treee5d18a225aee4d313dc6cdd74628d5e2c13c7820
parentd9ca54b6d2c6ea4faf35908e8f257bd60ea5f382 (diff)
downloadnasm-6d42e9ba4730dc8472e4ec698e2af549c53861c3.tar.gz
preproc: Warn if someone predefines non ID as definition
Not sure if someone is used this but to not break backward compatibility lets simply yield error but don't stop processing. http://bugzilla.nasm.us/show_bug.cgi?id=3392300 Reported-by: Dave Shields <thedaveshields@gmail.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r--preproc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/preproc.c b/preproc.c
index 12b39782..4e052989 100644
--- a/preproc.c
+++ b/preproc.c
@@ -5203,6 +5203,10 @@ static void pp_pre_define(char *definition)
if (equals)
*equals = '=';
+ if (space->next->type != TOK_PREPROC_ID &&
+ space->next->type != TOK_ID)
+ error(ERR_WARNING, "pre-defining non ID `%s\'\n", definition);
+
l = nasm_malloc(sizeof(Line));
l->next = predef;
l->first = def;