[phobos] compiler bug

Andrei Alexandrescu andrei at erdani.com
Sun Jul 4 13:35:03 PDT 2010


It looks like the crash was not cause by cacheIsBack, but by the 
replacement of

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

with

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

in std.array.back for arrays. Apparently this is a bug in the compiler. 
Replacing the assert with:

     assert(a.length);

fixes the problem.

Sorry for misattributing the cause of error. This underlines the 
necessity to carefully test changes in both debug and release modes. 
Five commits after a bug was introduced, nobody will know exactly what 
happened when.


Andrei



More information about the phobos mailing list