From 793cb20b7b8e94c607ad83b18892cc339862f96f Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 2 Feb 2016 13:34:08 -0800 Subject: don't accept -+ #163 --- src/parsing.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/parsing.h b/src/parsing.h index 817355e92..1ea0ec254 100644 --- a/src/parsing.h +++ b/src/parsing.h @@ -60,7 +60,11 @@ Expression* parseConst(cashew::IString s, WasmType type, MixedArena& allocator) } bool negative = str[0] == '-'; const char *positive = negative ? str + 1 : str; - if (positive[0] == '+') positive++; + if (!negative) { + if (positive[0] == '+') { + positive++; + } + } if (positive[0] == 'n' && positive[1] == 'a' && positive[2] == 'n') { const char * modifier = positive[3] == ':' ? positive + 4 : nullptr; assert(modifier ? positive[4] == '0' && positive[5] == 'x' : 1); -- cgit v1.2.3