Fix a dereference of an iterator one past the end.
parent
9f697af138
commit
c385740087
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue