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: [email protected]
Reporter: [email protected]
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[]
--