<div>It seemed I found possible llvm-g++ bug.</div><div>Programs compiled with llvm-g++ 4.5 crashed with SIGSEGV during stack unwinding in such testcase:</div><div><br><meta http-equiv="content-type" content="text/html; charset=utf-8"></div>
<div>chaos@chaos-desktop ~ % g++ --version</div><div>g++ (Ubuntu/Linaro 4.5.1-7ubuntu2) 4.5.1</div><div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>chaos@chaos-desktop ~ % echo "struct X{ ~X(){} }; int main() { X x; throw 1; }" > test.cpp && g++ test.cpp && ./a.out</div>
<div>terminate called after throwing an instance of 'int'</div><div>zsh: abort      ./a.out</div></div><div><br></div><div><br></div><div><br></div><div>chaos@chaos-desktop ~ % echo "struct X{ ~X(){} }; int main() { X x; throw 1; }" > test.cpp && llvm-g++ test.cpp && ./a.out </div>
<div>zsh: segmentation fault  ./a.out</div><div><br></div><div>chaos@chaos-desktop ~ % llvm-g++ --version</div><div>g++-4.5 (Ubuntu/Linaro 4.5.1-7ubuntu2) 4.5.1</div><div><br></div><div>chaos@chaos-desktop ~ % valgrind ./a.out                                                                                  </div>
<div>==19523== Memcheck, a memory error detector</div><div>==19523== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.</div><div>==19523== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for copyright info</div>
<div>==19523== Command: ./a.out</div><div>==19523==</div><div>vex x86->IR: unhandled instruction bytes: 0x36 0xE1 0xBE 0x0</div><div>==19523==</div><div>==19523== Process terminating with default action of signal 11 (SIGSEGV)</div>
<div>==19523==  Bad permissions for mapped region at address 0x42CAFF4</div><div>==19523==    at 0x42D1068: ???</div><div>==19523==    by 0x4187CE6: (below main) (libc-start.c:226)</div><div>==19523==</div><div><br></div>