D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4426 - assert(condition, string) fails in std.array.back
Summary: assert(condition, string) fails in std.array.back
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Linux
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-04 13:57 UTC by Andrei Alexandrescu
Modified: 2012-02-01 19:35 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Andrei Alexandrescu 2010-07-04 13:57:23 UTC
This test inside std.array.back causes a segfault:

        assert(a.length, "Attempting to fetch the back of an empty array");

This doesn't:

        assert(a.length);

The bug seems to manifest itself only on Linux and only in release mode. To reproduce, build Phobos on Linux like this:

make -f linux.mak unittest BUILD=release DMDEXTRAFLAGS="-version=bugXXXX"

where XXXX is the number of this bug report.
Comment 1 yebblies 2012-02-01 19:35:08 UTC
The workaround is gone from std.array.back.