mirror of
https://github.com/huderlem/porymap.git
synced 2026-09-09 17:35:37 -05:00
Fix freeze on mismatched parentheses
This commit is contained in:
@@ -241,10 +241,11 @@ QList<Token> ParseUtil::generatePostfix(const QList<Token> &tokens) {
|
||||
}
|
||||
|
||||
while (!operatorStack.isEmpty()) {
|
||||
if (operatorStack.top().value == "(" || operatorStack.top().value == ")") {
|
||||
Token token = operatorStack.pop();
|
||||
if (token.value == "(" || token.value == ")") {
|
||||
recordError("Mismatched parentheses detected in expression!");
|
||||
} else {
|
||||
output.append(operatorStack.pop());
|
||||
output.append(token);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user