[Issue 6531] assertion failure in std.range.iota

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 6 12:48:24 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=6531


Yao Gomez <yao.gomez at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yao.gomez at gmail.com


--- Comment #1 from Yao Gomez <yao.gomez at gmail.com> 2012-02-06 12:48:21 PST ---
With DMD 2.058HEAD the assertion is now at line 4136.

Doing a little bit of debugging, it seems that the line at 4135:
---
if (pastEnd < end) ++count;
---
is the culprit. With the r1 range, the count variable is correctly updated, as
both pastEnd and end are different.

But with the failling range (r2), pastEnd and end have the same value!, and
thus the count is not correctly updated.

Changing the previous code to:
---
if (pastEnd <= end) ++count;
---
seems to do the trick, and passes all the std.range unit tests. But I don't
know if that's the correct fix.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list