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

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

[Octave-bug-tracker] [bug #55523] segfault when default argument of anon


From: Rik
Subject: [Octave-bug-tracker] [bug #55523] segfault when default argument of anonymous/nested function is the same name as argument
Date: Sun, 3 Feb 2019 10:32:18 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Update of bug #55523 (project octave):

                Priority:              5 - Normal => 3 - Low                

    _______________________________________________________

Follow-up Comment #4:

Adding jwe to the CC list.

The new refactoring of the symbol table and how functions are stored has
stopped the segfaults reportedi in this bug report.  However, that is on the
development branch which won't become Octave 6.1 for another year.  If there
was an easy patch for 5.1 that would be nice.  Otherwise, I have dropped the
priority to low since this is a 

However, I still think the results of this example are incorrect


octave:11> a = 1;
octave:12> b = 2;
octave:13> %Segmentation fault
octave:13> fb_disp = @(a = b) disp(a);
octave:14> fb_disp();
error: 'b' undefined near line 2 column 17
error: called from
    @<anonymous>


I would have thought that the variable 'b' would have been replaced with the
value 2 when the anonymous function was defined.

In terms of compatibility, we don't need to worry.  Matlab doesn't even allow
default arguments to anonymous functions.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55523>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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