bugGNU Octave - Bugs: bug #51785, Inconsistent behavior of various...


bug #51785: Inconsistent behavior of various shaped empty index vectors in for loops

Submitted by:  Geoffrey Adams <biogeo>
Submitted on:  Fri 18 Aug 2017 05:52:06 PM UTC  
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Duplicate Assigned to:  None
Originator Name:  Geoffrey Adams Open/Closed:  Closed
Release:  4.0.3 Operating System:  GNU/Linux

Add a New Comment(Rich Markup)

You are not logged in

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


Fri 18 Aug 2017 06:05:44 PM UTC, comment #1:

Thanks for your bug report. This looks like it covers the same ground as bug #50893, which has already been fixed on the default branch. Indeed your last example does work correctly on Octave's default branch. So this will be working correctly in Octave's 4.4 release.

Mike Miller <mtmiller>
Project Administrator
Fri 18 Aug 2017 05:52:06 PM UTC, original submission:

When supplying an empty matrix as the index vector to a for loop, the expected behavior is that the loop body is skipped, as in the following:

However, for empty matrices that are not shaped as 0-by-0, this is not always the case. In particular, while the following behaves as expected:

the following does not:

Geoffrey Adams <biogeo>


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

Attach Files:

No files currently attached


   bug dependencies.

Items that depend on this one: None found


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

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

    Only project members can vote.




    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-08-18 mtmiller Dependencies- => Depends on bugs #50893
    2017-08-18 mtmiller StatusNone => Duplicate
        Open/ClosedOpen => Closed

    Back to the top

    Powered by Savane 3.4