bugGNU Octave - Bugs: bug #35876, Saving anonymous functions fails...

 
 

bug #35876: Saving anonymous functions fails in recursive functions

Submitter:  Max Brister <fisheater>
Submitted:  Sat 17 Mar 2012 04:55:39 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Max Brister Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 25 Aug 2012 10:31:31 PM UTC, comment #5: 

John,

Sure, I can see how that would make things easier.

Max Brister <fisheater>
Sat 25 Aug 2012 10:25:26 PM UTC, comment #4: 

Max, thanks for fixing this problem.

In the future, would you please use a link to the changeset on savannah instead of just the changeset ID?

John W. Eaton <jwe>
Group administrator
Sat 25 Aug 2012 10:17:27 PM UTC, comment #3: 

Pushed fix in ab3d4c1affee

Max Brister <fisheater>
Fri 23 Mar 2012 05:37:59 PM UTC, comment #2: 

After looking back at the code, the unlink was not duplicate. annon3.patch should be correct.

(file #25457)

Max Brister <fisheater>
Fri 23 Mar 2012 04:22:56 PM UTC, comment #1: 

I have attached a revised patch. It was created following the new patch guidelines (http://www.octave.org/wiki/index.php?title=Mercurial_(hg)_cheat_sheet).

Also, it removes a double unlink in both the added test case and the test case which it was based off of.

(file #25456)

Max Brister <fisheater>
Sat 17 Mar 2012 04:55:39 PM UTC, original submission:  

Saving an anonymous function fails whenever symbol_table::current_context () is nonzero. I have attached a script which exhibits this functionality.

save_test (1)

fails as it is called when current_context is nonzero but

save_test (0)

works as current_context is zero.

I have also attached a patch that fixes this issue in addition to adding a test case. The fix is to call varval (0) when saving the variables of an anonymous function. This causes the anonymous function's variables to correctly be accessed from context 0, instead of the current_context.

I am guessing this bug also appears in any previous release that allows for anonymous functions to be saved, but I have not checked.

Max Brister

Max Brister <fisheater>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #25457:  anon3.patch added by fisheater (3KiB - text/x-patch)
file #25456:  anon2.patch added by fisheater (3KiB - text/x-patch)
file #25382:  save_test.m added by fisheater (150B - text/x-objcsrc)
file #25383:  anon.patch added by fisheater (3KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by fisheater (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-08-25 fisheater StatusNone Fixed
        Open/ClosedOpen Closed
    2012-03-23 fisheater Attached File- Added anon3.patch, #25457
    2012-03-23 fisheater Attached File- Added anon2.patch, #25456
    2012-03-17 fisheater Attached File- Added save_test.m, #25382
        Attached File- Added anon.patch, #25383

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code