Thread overview
[Issue 19042] Chunking a padRight'ed range leads to range violations
Feb 17, 2019
Jon Degenhardt
Feb 17, 2019
Jon Degenhardt
Feb 18, 2019
Dlang Bot
February 17, 2019
https://issues.dlang.org/show_bug.cgi?id=19042

Jon Degenhardt <jrdemail2000-dlang@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jrdemail2000-dlang@yahoo.co
                   |                            |m

--- Comment #1 from Jon Degenhardt <jrdemail2000-dlang@yahoo.com> ---
This bug is triggered when a slice is taken entirely from the pad section at the end of the range. Here's another variation:

---- issue_19042.d ----
import std.range;
import std.stdio;

void main(string[] args)
{
    auto r = [1, 2, 3, 4].padRight(0, 10);
    writeln("r[7 .. 9] : ", r[7 .. 9]);
}

---- Run -------

$ dmd issue_19042.d

$ ./issue_19042 core.exception.RangeError@INSTALLDIR/dmd2-2.084.0/osx/bin/../../src/phobos/std/range/package.d(12868): Range violation
----------------
??:? _d_arrayboundsp [0x73c2b71]
??:? pure nothrow @nogc @safe std.range.padRight!(int[], int).padRight(int[],
int, ulong).Result std.range.padRight!(int[], int).padRight(int[], int,
ulong).Result.opSlice(ulong, ulong) [0x73aab65]
??:? _Dmain [0x73aa596]

--
February 17, 2019
https://issues.dlang.org/show_bug.cgi?id=19042

--- Comment #2 from Jon Degenhardt <jrdemail2000-dlang@yahoo.com> ---
Phobos PR 6865: https://github.com/dlang/phobos/pull/6865

--
February 18, 2019
https://issues.dlang.org/show_bug.cgi?id=19042

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/phobos pull request #6865 "Fix issues 19042, 19681 - std.range.padRight bugs" was merged:

https://github.com/dlang/phobos/pull/6865

--