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

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

[Octave-bug-tracker] [bug #47705] function "localfunctions" not implemen


From: Lachlan Andrew
Subject: [Octave-bug-tracker] [bug #47705] function "localfunctions" not implemented
Date: Sun, 22 May 2016 10:21:21 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Update of bug #47705 (project octave):

                  Status:             In Progress => Patch Submitted        

    _______________________________________________________

Follow-up Comment #17:

Rik, thanks for the debugging.  I must just never have tested this case.

It seems the current localfunctions() behaviour is the best that is possible
until it is possible to take handles of nested functions (see bug #39257). 
Taking @c gives an error, and so it is consistent that localfunctions() cannot
return a handle to c.  I'm setting the status back to "Patch submitted".

I haven't been able to find out exactly why it is not allowed to take handles
of the *outermost* nested function -- the inner ones obviously have problems
because they share memory with the outer function and so assume its stack
frame exists, but that isn't a problem for the outermost since calling it
would create the stack frame.

However, the code in symtab.cc (around line 1652) explicitly says


  if (nest_parent || nest_children.size ())
    curr_fcn->mark_as_nested_function ();


and the only time  is_nested_function ()  was used was the decision of whether
or not to allow handles to be taken, so it wasn't an unintentional
side-effect.

My cavalier side would just allow taking handles of the outermost function,
and wait for someone to report breakage :-) but of course I wouldn't suggest
that on anything that could possibly make its way into production code.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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