diff --git a/src/core/parseutil.cpp b/src/core/parseutil.cpp index 5448229c..04cdbcc7 100644 --- a/src/core/parseutil.cpp +++ b/src/core/parseutil.cpp @@ -241,10 +241,11 @@ QList ParseUtil::generatePostfix(const QList &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); } }