1
0
Fork 0

DBG: fix an out of bounds access on expression "([esp])"

This commit is contained in:
Duncan Ogilvie 2018-03-26 02:14:49 +02:00
parent fa902f5df7
commit 3f754c0bfc
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
1 changed files with 3 additions and 3 deletions

View File

@ -425,10 +425,10 @@ void ExpressionParser::shuntingYard()
break;
queue.push_back(curToken);
}
const auto & top = stack[stack.size() - 1];
if(!stack.empty() && top.type() == Token::Type::Function) //If the token at the top of the stack is a function token, pop it onto the output queue.
auto size = stack.size();
if(size && stack[size - 1].type() == Token::Type::Function) //If the token at the top of the stack is a function token, pop it onto the output queue.
{
queue.push_back(top);
queue.push_back(stack[size - 1]);
stack.pop_back();
}
}