www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Array!bool -> Chunks -> foreach: out of bounds

reply 0xEAB <desisma heidel.beer> writes:
 core.exception.AssertError /src/phobos/std/container/array.d(1667): Using out
of bounds indexes on an Array
Should this code[1] really try to access something out of bounds and assert? Also: shouldn't this assertion[2] be perhaps inside `version(D_NoBoundsChecks){} else { ... }` block? Kind regards, Elias [1] https://run.dlang.io/is/l6eyCF [2] https://github.com/dlang/phobos/blob/v2.081.2/std/container/array.d#L1667
Aug 15 2018
parent reply Kagamin <spam here.lot> writes:
It's a bug:

     auto s=ar[];
     s.popFront();
     auto s1=s[0..0]; //out of bounds
Aug 15 2018
parent reply 0xEAB <desisma heidel.beer> writes:
On Wednesday, 15 August 2018 at 15:13:50 UTC, Kagamin wrote:
 It's a bug:
Is it a known one?
Aug 15 2018
parent reply Steven Schveighoffer <schveiguy gmail.com> writes:
On 8/15/18 12:27 PM, 0xEAB wrote:
 On Wednesday, 15 August 2018 at 15:13:50 UTC, Kagamin wrote:
 It's a bug:
Is it a known one?
Nope. And I figured out the problem. Will submit a fix. -Steve
Aug 15 2018
parent reply Steven Schveighoffer <schveiguy gmail.com> writes:
On 8/15/18 2:05 PM, Steven Schveighoffer wrote:
 On 8/15/18 12:27 PM, 0xEAB wrote:
 On Wednesday, 15 August 2018 at 15:13:50 UTC, Kagamin wrote:
 It's a bug:
Is it a known one?
Nope. And I figured out the problem. Will submit a fix.
https://issues.dlang.org/show_bug.cgi?id=19171 -Steve
Aug 15 2018
parent reply Steven Schveighoffer <schveiguy gmail.com> writes:
On 8/15/18 2:12 PM, Steven Schveighoffer wrote:
 
 https://issues.dlang.org/show_bug.cgi?id=19171
 
PR: https://github.com/dlang/phobos/pull/6666 -Steve
Aug 15 2018
parent 0xEAB <desisma heidel.beer> writes:
On Wednesday, 15 August 2018 at 18:27:56 UTC, Steven 
Schveighoffer wrote:
 PR: https://github.com/dlang/phobos/pull/6666

 -Steve
Thank you for looking into this one. Regards, Elias
Aug 17 2018