A nice way to step into 2012
    Andrei Alexandrescu 
    SeeWebsiteForEmail at erdani.org
       
    Tue Dec 27 07:44:49 PST 2011
    
    
  
On 12/27/11 9:21 AM, Joshua Reusch wrote:
> Am 27.12.2011 05:25, schrieb Andrei Alexandrescu:
>> https://github.com/D-Programming-Language/dmd/commit/675898721c04d0bf155a85abf986eae99c37c0dc
>>
>>
>>
>> Andrei
>
> -------------
> import std.algorithm;
>
> void main() {
> auto arr = [0, 5, 4, 3, 2, 1];
> sort!((a, b) => a < b)(arr);
> }
> -------------
> $ ./dmd lambda_test
> dmd: malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbinptr)
> (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct
> malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >=
> (unsigned long)((((__builtin_offsetof (struct malloc_chunk,
> fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) -
> 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask)
> == 0)' failed.
> $
>
>
> This also "works" with other functions from std.algorithm.
Not even 11h before the first bug report. What's odd about this is that 
the code works with both the string syntax and the "long lambda" syntax, 
and the new syntax is simply doing a rewrite to the long lambda syntax.
Andrei
    
    
More information about the Digitalmars-d
mailing list