[cfe-commits] r58100 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/SemaCXX/fntype-decl.cpp
Chris Lattner
clattner at apple.com
Mon Oct 27 13:56:43 PDT 2008
On Oct 25, 2008, at 2:07 AM, Argiris Kirtzidis wrote:
> Doug Gregor wrote:
>> Thanks for the diagnosis; I'll get this fixed. It sure would have
>> been
>> nice if it crashed on Mac OS :)
>>
>
> 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.
Also, #ifdef NDEBUG would mean that we couldn't mix assert .o's with
non-assert .o's. Maybe it would be better for them to be out of line
to fix that problem?
-Chris
More information about the cfe-commits
mailing list