[cfe-commits] r58100 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/SemaCXX/fntype-decl.cpp

Argiris Kirtzidis akyrtzi at gmail.com
Tue Oct 28 03:10:24 PDT 2008


Chris Lattner wrote:
>
> On Oct 25, 2008, at 2:07 AM, Argiris Kirtzidis wrote:
>
>>
>> Here's something to help you on the crash department.
>> The attached patch modifies llvm::MallocAllocator and gets it to fill 
>> the object with garbage before free'ing it.
>> Try applying it and running the tests.
>> This is what the MS debug CRT does automatically and it works great 
>> for catching this kind of bugs.
>>
>> Is it reasonable to add something like this patch on llvm and have it 
>> enabled for debug builds ?
>
> The idea of this patch is very nice.  One bad thing is that it means 
> that the returned pointer only has 32-bit alignment instead of 64-bit 
> (on linux) or 128-bit on darwin.

Depending on the alignment of MallocAllocator is not portable at the 
moment (code that depends on alignment should use BumpPtrAllocator).
How about adding an assert that goes off if an allocation with specific 
alignment is requested ?

-Argiris



More information about the cfe-commits mailing list