changeset 25814:a8a72d1c21dd stable

correctly copy base class for colon and funcall parse tree objects (bug #47091) * pt-colon.cc (tree_colon_expression::dup): Pass *this to copy_base, not the newly created object. * pt-funcall.cc (tree_funcall::dup): Likewise.
author John W. Eaton <jwe@octave.org>
date Sat, 18 Aug 2018 12:43:43 -0400
parents 7233dae64579
children 849f1a7e9a30 dc70b480b9c1
files libinterp/parse-tree/pt-colon.cc libinterp/parse-tree/pt-funcall.cc
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-colon.cc	Fri Aug 17 14:04:51 2018 -0700
+++ b/libinterp/parse-tree/pt-colon.cc	Sat Aug 18 12:43:43 2018 -0400
@@ -39,7 +39,7 @@
                                    m_increment ? m_increment->dup (scope) : nullptr,
                                    line (), column ());
 
-    new_ce->copy_base (*new_ce);
+    new_ce->copy_base (*this);
 
     return new_ce;
   }
--- a/libinterp/parse-tree/pt-funcall.cc	Fri Aug 17 14:04:51 2018 -0700
+++ b/libinterp/parse-tree/pt-funcall.cc	Sat Aug 18 12:43:43 2018 -0400
@@ -73,7 +73,7 @@
     tree_funcall *new_fc
       = new tree_funcall (m_fcn, m_args, line (), column ());
 
-    new_fc->copy_base (*new_fc);
+    new_fc->copy_base (*this);
 
     return new_fc;
   }