octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #45209] parser assertion failure and crash whe


From: Rik
Subject: [Octave-bug-tracker] [bug #45209] parser assertion failure and crash when "echo on all" is used
Date: Sun, 22 Nov 2015 04:09:25 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0

Follow-up Comment #2, bug #45209 (project octave):

Apparently this has never worked correctly, although it didn't segfault.  The
problem seems to be that curr_print_indent_level is not correctly incremented
after the printing of the function header.  You can see this because all of
the function body is at the same level of indent--that is 0--during the
echoing.  It is only when another keyword which would increase indent, such as
an 'if' statement, is encountered that the indent is increased.

I've attached pack2.m which is the file that I have been using for testing.  I
instrumented the code in pt-pr-code.cc and I can see that the code path is
probably not what was expected.  It seems that the path begins in
ov-usr-fcn.cc in do_multi_index_op where print_code_function_header is called.
 This, in turn, calls visit_octave_user_function_header in pt-pr-code.cc. 
>From reading the code in pt-pr-code.cc, it looks like the intended path may
have been to call visit_octave_user_function().  That function in turn calls
visit_octave_user_function_header() but it also has the code to call
increment_indent_level().

Just to see if there was an easy fix, I added a call to
increment_indent_level() at the end of visit_octave_user_function_header(). 
This correctly does the increment, but the next time the indent() function is
called the value is back to 0.  I think this may be because the original call
back in ov-usr-fcn.cc is sitting in an unwind/protect frame.  If that is the
case, I'm not quite sure how to fix this crash.

I've added jwe to the CC list of the bug since this bug is beyond me.

Here is the test sequence I used.


more off
echo on all
pack2



(file #35518)
    _______________________________________________________

Additional Item Attachment:

File name: pack2.m                        Size:0 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?45209>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]