digitalmars.D.bugs - [Issue 21679] New: Assertion failure in Base64.encoder for empty
- d-bugmail puremagic.com (28/28) Mar 04 2021 https://issues.dlang.org/show_bug.cgi?id=21679
https://issues.dlang.org/show_bug.cgi?id=21679 Issue ID: 21679 Summary: Assertion failure in Base64.encoder for empty input range of ranges Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: major Priority: P1 Component: phobos Assignee: nobody puremagic.com Reporter: sludwig outerproduct.org Passing an empty range of chunks to Base64.encoder unconditionally accesses the `.front` of the chunk range, resulting in the following code to fail with an assertion error: --- import std; void main() { ubyte[][] input; assert(Base64.encoder(input).empty); } --- core.exception.AssertError /dlang/dmd/linux/bin64/../../src/phobos/std/range/primitives.d(2432): Attempting to fetch the front of an empty array of ubyte[] --
Mar 04 2021