[llvm-bugs] [Bug 46584] New: win32 std::current_exception miscompilation

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jul 4 11:23:04 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46584

            Bug ID: 46584
           Summary: win32 std::current_exception miscompilation
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Keywords: miscompilation
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: nok.raven at gmail.com
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, spatel+llvm at rotateright.com

This is probably oversimplified reproducer of Boost crash: 
https://github.com/boostorg/thread/pull/320#issuecomment-653677766

#include <exception>

template <class T>
inline std::exception_ptr make_exception_ptr(T e)
{
    try {
        throw e;
    }
    catch(...) {
        return std::current_exception();
    }
}

struct X {};

int main()
{
    try
    {
        std::rethrow_exception(make_exception_ptr(X{}));
    }
    catch(X const&)
    {
    }
}

clang-cl /O2 /EHsc /DNDEBUG -m32 z.cpp

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200704/524e57a8/attachment.html>


More information about the llvm-bugs mailing list