[LLVMdev] Interactions between LLVM and the Microsoft C++ runtime

Duncan Sands baldrick at free.fr
Tue Jan 20 23:54:21 PST 2009


Hi,

> The problem that I've run into is that the LLVM codebase does  
> certain "idiomatic" things with STL containers that cause assertion  
> failures in the Microsoft runtime. Most notably:
> - Taking the address of the "first element" of an emtpy vector  
> (either &v[0] or &*v.begin())
> - Using an iterator into a collection (even if just for iterator  
> comparison) after an erase() or similar on that collection has  
> invalidated all iterators
> These assertions can occur in both debug and release configurations  
> (Microsoft includes certain assertions in the release runtime for  
> "security").

if you configure with --enable-expensive-checks on linux then I
think all of these are checked.  The upcoming 2.5 llvm build is
mostly clean but some issues did come up when building llvm-gcc.
They are being worked on (at least I hope they are!), PR3358.

Ciao,

Duncan.



More information about the llvm-dev mailing list