From 06bbe56701568ac5c6dc9b80489d2e0c0b623d77 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 17 Aug 2008 04:55:01 -0400 Subject: [PATCH] Fixed an assertion. --- src/op.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/op.h b/src/op.h index b155063d..6f81c155 100644 --- a/src/op.h +++ b/src/op.h @@ -214,16 +214,16 @@ public: return left_; } const ptr_op_t& left() const { - assert(kind > TERMINALS); + assert(kind > TERMINALS || kind == IDENT); return left_; } void set_left(const ptr_op_t& expr) { - assert(kind > TERMINALS); + assert(kind > TERMINALS || kind == IDENT); left_ = expr; } ptr_op_t& as_op_lval() { - assert(kind > TERMINALS); + assert(kind > TERMINALS || kind == IDENT); return boost::get(data); } const ptr_op_t& as_op() const { @@ -305,8 +305,8 @@ inline expr_t::ptr_op_t expr_t::op_t::new_node(kind_t _kind, ptr_op_t _left, ptr_op_t _right) { ptr_op_t node(new op_t(_kind)); - node->set_left(_left); - node->set_right(_right); + if (_left) node->set_left(_left); + if (_right) node->set_right(_right); return node; }