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

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

[Octave-bug-tracker] [bug #60845] Variables in nested functions exhibit


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #60845] Variables in nested functions exhibit multiple problems
Date: Tue, 29 Jun 2021 05:15:46 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Follow-up Comment #9, bug #60845 (project octave):

I think the reason the behavior seemed so strange before the patch is that
variable values in a stack frame are accessed by an offset into an array.  If
the offsets are wrong the results appear random.  In this case, it seems that
the offsets were computed correctly (looking at the correct parent function
for non-local variables) but then applied to the wrong stack frame (the
sibling nested function instead of the parent).

Regarding the duplicate names in the list produced by "who", can someone check
what a recent version of Matlab does?  I remember asking about this behavior
when I was working on nested functions in the last couple of years and finding
that it also displays duplicates but I can't find the test cases and output
now.

As you noticed, the output of "whos" makes a little more sense.  As far as I
know, "who" just goes through the scopes/stack frames in the same way and
gathers all the names.  I agree that having duplicate names in the output of
"who" is strange, but if that is what Matlab does, I'm somewhat inclined to
leave it alone.

In any case, I will make the change on stable and merge with default.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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