express: More robust parsing fix (nw)

This commit is contained in:
Olivier Galibert 2017-03-27 20:32:07 +02:00
parent 0dd55128b9
commit a43db4ab22

View File

@ -873,12 +873,17 @@ void parsed_expression::parse_symbol_or_number(parse_token &token, const char *&
string++; string++;
} }
// check for memory @ operators // check for memory @ and ! operators
if ((string[0] == '@' || string[0] == '!') && (buffer.back() == 'b' || buffer.back() == 'w' || buffer.back() == 'd' || buffer.back() == 'q')) if (string[0] == '@' || string[0] == '!')
{ {
bool with_se = string[0] == '!'; try {
string += 1; bool with_se = string[0] == '!';
return parse_memory_operator(token, buffer.c_str(), with_se); parse_memory_operator(token, buffer.c_str(), with_se);
string += 1;
return;
} catch(const expression_error &e) {
// Try some other operator instead
}
} }
// empty string is automatically invalid // empty string is automatically invalid