Fix two tests in Win64 ASan
authorReid Kleckner <rnk@google.com>
Fri, 5 Aug 2016 21:47:46 +0000 (21:47 +0000)
committerReid Kleckner <rnk@google.com>
Fri, 5 Aug 2016 21:47:46 +0000 (21:47 +0000)
commit9cba2e2d97e88633bf5a42ec2f73121f0a72a8d4
tree5d54fc0a67efe65a2916201994640bb9f1169d48
parent7af95876cf8f289f0d8d1fb0c0411464898ed641
Fix two tests in Win64 ASan

Go back to intercepting kernel32!RaiseException, and only go for
ntdll!RtlRaiseException if that fails. Fixes throw_and_catch.cc test.

Work around an issue in LLVM's win64 epilogues. We end up with an
epilogue that looks like this, and it drives the Win64 unwinder crazy
until stack overflow:
        call    ill_cc!__asan_handle_no_return
        xor     eax,eax
        add     rsp,40h // epilogue starts
        pop     rbp     // CSR
        ud2             // Trap here
        ret             // Ret?
        nop     word ptr [rax+rax]
        sub     rsp,28h // Next function

Will file a PR soon.

llvm-svn: 277874
compiler-rt/lib/asan/asan_win.cc
compiler-rt/test/asan/TestCases/Windows/dll_host.cc
compiler-rt/test/asan/TestCases/ill.cc