changeset 20732:771d9fab5c24

Stop assertion crash when 'echo on all' used (bug #45209). * pt-pr-code.cc (visit_no_op_command): When end-of-function encountered, check that indent level is greater than 1 before decreasing indent to avoid negative values which trigger assertion crash in indent().
author Rik <rik@octave.org>
date Sun, 22 Nov 2015 08:09:36 -0800
parents 83611b387bc5
children c6464d78da69
files libinterp/parse-tree/pt-pr-code.cc
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-pr-code.cc	Sat Nov 21 14:47:22 2015 +0100
+++ b/libinterp/parse-tree/pt-pr-code.cc	Sun Nov 22 08:09:36 2015 -0800
@@ -719,7 +719,7 @@
 void
 tree_print_code::visit_no_op_command (tree_no_op_command& cmd)
 {
-  if (cmd.is_end_of_fcn_or_script ())
+  if (cmd.is_end_of_fcn_or_script () && curr_print_indent_level > 1)
     decrement_indent_level ();
 
   indent ();