Fix a dereference of an iterator one past the end.

pull/106/head
whitequark 2017-01-03 01:21:38 +00:00
parent 9f697af138
commit c385740087
1 changed files with 1 additions and 1 deletions

View File

@ -684,7 +684,7 @@ ExprParser::Token ExprParser::LexNumber(std::string *error) {
double d = strtod(s.c_str(), &endptr); double d = strtod(s.c_str(), &endptr);
Token t = Token::From(); Token t = Token::From();
if(endptr == &*s.end()) { if(endptr == s.c_str() + s.size()) {
t = Token::From(TokenType::OPERAND, Expr::Op::CONSTANT); t = Token::From(TokenType::OPERAND, Expr::Op::CONSTANT);
t.expr->v = d; t.expr->v = d;
} else { } else {