From 927d404ad5d145bbcc58e0a4f9ee5d5df0637160 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 13 Mar 2012 10:33:59 -0500 Subject: Added a syntax error check --- src/op.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/op.cc') diff --git a/src/op.cc b/src/op.cc index 7f2418b1..8be0796a 100644 --- a/src/op.cc +++ b/src/op.cc @@ -198,6 +198,9 @@ expr_t::ptr_op_t expr_t::op_t::compile(scope_t& scope, const int depth, } if (! result) { + if (! left()) + throw_(calc_error, _("Syntax error")); + ptr_op_t lhs(left()->compile(*scope_ptr, depth + 1, param_scope)); ptr_op_t rhs(kind > UNARY_OPERATORS && has_right() ? (kind == O_LOOKUP ? right() : -- cgit v1.2.3