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

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

[Octave-bug-tracker] [bug #48665] calling continue in a function outside


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #48665] calling continue in a function outside of a conditional or loop silences stdout, may crash Octave
Date: Fri, 28 Oct 2016 00:23:48 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0

Follow-up Comment #5, bug #48665 (project octave):

The segfault here is due to the changes to how errors are handled and
propagated. Whatever is happening with the "continue" in a user function, it
is also preventing the error() function from behaving properly inside user
functions. Since print_usage doesn't throw an error, the builtin function
"all" with no arguments continues running as if it had valid args, and
dereferences a bad pointer.

Observe



>> function foo, continue, endfunction;
>> foo
>> lasterr
ans = 
>> error asdfasdfasdf;
error: asdfasdfasdf
>> lasterr
ans = asdfasdfasdf
>> lasterror reset;
>> 
>> print_usage ("all")
>> lasterr
ans = 



In 4.0 and earlier versions, we always followed print_usage with a return
statement, so even if the error message was suppressed and the error state not
correctly recorded, the builtin function still returned control early.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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