diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2014-04-25 17:31:17 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2014-08-02 11:08:03 +0200 |
commit | d94b18819ad4ee3237c46ad43a962d0121f0c3fe (patch) | |
tree | e20cb5bf68323c618df7d426bf1e0dce791f0692 /src/expressions.cpp | |
parent | d90d3accdb574145a388e9d2825991a14c72960d (diff) | |
download | sciteco-d94b18819ad4ee3237c46ad43a962d0121f0c3fe.tar.gz |
ensure that expressions.eval(true) pops the brace "operator"
test case: 1<()>
* an empty brace (or content that does not leave anything on the stack)
resulted in the brace op to be left on the stack which makes the op stack
inconsistent
Diffstat (limited to 'src/expressions.cpp')
-rw-r--r-- | src/expressions.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/expressions.cpp b/src/expressions.cpp index 03febf1..87785a7 100644 --- a/src/expressions.cpp +++ b/src/expressions.cpp @@ -176,9 +176,6 @@ Expressions::eval(bool pop_brace) gint n = first_op(); Operator op; - if (n < 2) - break; - op = operators.peek(n); if (op == OP_LOOP) break; @@ -187,6 +184,8 @@ Expressions::eval(bool pop_brace) pop_op(n); break; } + if (n < 2) + break; calc(); } |