bugGNU Octave - Bugs: bug #36240, incorrect isargout after using a...

 
 

bug #36240: incorrect isargout after using a trailing ~ once

Submitter:  John Hunt <huntj>
Submitted:  Wed 18 Apr 2012 02:53:05 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 18 Apr 2012 07:31:04 PM UTC, comment #6: 

That's working perfectly, thank you !

John Hunt <huntj>
Wed 18 Apr 2012 06:24:15 PM UTC, comment #5: 

I checked in teh following change on the stable branch:

http://hg.savannah.gnu.org/hgweb/octave/rev/6131fead3135

This fix will appear in the upcoming 3.6.2 release.

It appears to fix the problem for me, so I'm closing this report.

John W. Eaton <jwe>
Group administrator
Wed 18 Apr 2012 05:22:34 PM UTC, comment #4: 

I still feel that the 5th output :


octave:5> [x, y] = try_isargout()
warning: nbh: 0
ans =

   1   0

should yield 1 1 instead of 1 0,
shouldn't it ?

It did before calling [x, ~] = try_isargout()
(see output 1).

John Hunt <huntj>
Wed 18 Apr 2012 05:17:53 PM UTC, comment #3: 

comment #1: I agree...
hg id
3a9a56999ce5+

John Hunt <huntj>
Wed 18 Apr 2012 04:27:44 PM UTC, comment #2: 

Looking at the help string for isargou(), I think it is working as intended.

The solution is to use "nagout () >= n" in place of "isargout (n)" when assigning  the output variables.

Ben Abbott <bpabbott>
Group Member
Wed 18 Apr 2012 03:04:55 PM UTC, comment #1: 

Small favour, what is "the latest hg pull"? Please report the output of "hg id".

Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Wed 18 Apr 2012 02:53:05 PM UTC, original submission:  

The following bug is probably the reason for
bug #36221
which is thus not limited to unique.


the try_isargout.m function attached does not work after
being called with a trailing ~ as in
[x, ~] = try_isargout()


octave:1> [x, y] = try_isargout()
warning: nbh: 0
ans =

   1   1

x =  4
y =  5
octave:2> [x] = try_isargout()
warning: nbh: 0
ans =

   1   0

x =  4
octave:3> [x, y] = try_isargout()
warning: nbh: 0
ans =

   1   1

x =  4
y =  5
octave:4> [x, ~] = try_isargout()
warning: nbh: 1
ans =

   1   0

x =  4
octave:5> [x, y] = try_isargout()
warning: nbh: 0
ans =

   1   0

x =  4
y = [](0x0)



it seems that p->is_black_hole() returns wrong results,
since nbh is wrong. This sis shown by the warnings I added
line 612 of src/ov-usr-fcn.cc :


 for (std::list<octave_lvalue>::const_iterator p = lvalue_list->begin ();
           p != lvalue_list->end (); p++)
        nbh += p->is_black_hole ();

          warning("nbh: %d", nbh);


the behaviour is the same in 3.6.1 and in
the latest hg pull

John Hunt <huntj>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #25682:  try_isargout.m added by huntj (156B - text/x-matlab)

 

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 bpabbott (Posted a comment)
  • -email is unavailable- added by jordigh (Posted a comment)
  • -email is unavailable- added by huntj (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-04-18 jwe StatusNone Fixed
        Open/ClosedOpen Closed
    2012-04-18 huntj Attached File- Added try_isargout.m, #25682

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code