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

 
 

bug #35876: Saving anonymous functions fails in recursive functions

Submitted by:  Max Brister <fisheater>
Submitted on:  Sat 17 Mar 2012 04:55:39 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Max BristerOpen/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project Member
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>
Project Administrator
Sat 25 Aug 2012 10:17:27 PM UTC, comment #3:

Pushed fix in ab3d4c1affee

Max Brister <fisheater>
Project Member
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>
Project Member
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>
Project Member
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.
fails as it is called when current_context is nonzero but
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>
Project Member

 

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

Attach File(s):
   
   
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
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by fisheater (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 25 Aug 2012 10:17:27 PM UTCfisheaterStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Fri 23 Mar 2012 05:37:59 PM UTCfisheaterAttached File-=>Added anon3.patch, #25457
    Fri 23 Mar 2012 04:22:56 PM UTCfisheaterAttached File-=>Added anon2.patch, #25456
    Sat 17 Mar 2012 04:55:39 PM UTCfisheaterAttached File-=>Added save_test.m, #25382
      Attached File-=>Added anon.patch, #25383

    Back to the top


    Powered by Savane 3.1-cleanup1