diff libinterp/parse-tree/pt-cbinop.h @ 23522:d2e300f7700c

fix compound binary op error introduced in c452180ab672 Access correct operator and operands when evaluating compound binary expressions. * pt-binop.h (tree_binary_expression::lhs, tree_binary_expression::rhs): Now virtual. * pt-cbinop.h (tree_compound_binary_expression::cop_lhs, tree_compound_binary_expression::cop_rhs): Rename from op_lhs and op_rhs. (tree_compound_binary_expression::lhs, tree_compound_binary_expression::rhs): New functions. * pt-eval.cc ((tree_evaluator::visit_compound_binary_op): Use compound_binary_op expression type instead of binary_op expression type in call to do_binary_op.
author John W. Eaton <jwe@octave.org>
date Tue, 23 May 2017 13:55:43 -0400
parents d6e81498e7fe
children d2748870db4e
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-cbinop.h	Tue May 23 12:24:44 2017 -0400
+++ b/libinterp/parse-tree/pt-cbinop.h	Tue May 23 13:55:43 2017 -0400
@@ -48,13 +48,16 @@
                                      octave_value::binary_op t,
                                      tree_expression *ca, tree_expression *cb,
                                      octave_value::compound_binary_op ct)
-      : tree_binary_expression (a, b, l, c, t), op_lhs (ca), op_rhs (cb),
+      : tree_binary_expression (a, b, l, c, t), cop_lhs (ca), cop_rhs (cb),
         etype (ct) { }
 
     octave_value::compound_binary_op cop_type (void) const { return etype; }
 
     bool rvalue_ok (void) const { return true; }
 
+    tree_expression * lhs (void) { return cop_lhs; }
+    tree_expression * rhs (void) { return cop_rhs; }
+
     void accept (tree_walker& tw)
     {
       tw.visit_compound_binary_expression (*this);
@@ -62,8 +65,9 @@
 
   private:
 
-    tree_expression *op_lhs;
-    tree_expression *op_rhs;
+    tree_expression *cop_lhs;
+    tree_expression *cop_rhs;
+
     octave_value::compound_binary_op etype;
 
     // No copying!