[llvm-bugs] [Bug 30747] New: Windows x64 SEH __except filter continuing to __finally gets UD2

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Oct 20 09:18:24 PDT 2016


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

            Bug ID: 30747
           Summary: Windows x64 SEH __except filter continuing to
                    __finally gets UD2
           Product: new-bugs
           Version: 3.8
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: nb at ravenbrook.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17465
  --> https://llvm.org/bugs/attachment.cgi?id=17465&action=edit
C source with detailed disassembly in comment

Clang 3.8.0 on Windows 7, when compiling a __try { ... } __except (...) { ...}
inside a __try { ... } __finally { ... }, the __finally { ... } clause
generates a cleanup function which is garbled and includes a UD2.  I believe
that the semantics of this are well-defined, and I get sensible behaviour with
Visual Studio compilers.  Here's my code snippet, and attached is a detailed
disassembly in which I've picked apart the UNWIND_INFO and ScopeRecords and so
forth.

int f(void)
{
    int x = 3;
    __try {
        __try {
            g(3, &x);
        } __except((x == 42) ? EXCEPTION_EXECUTE_HANDLER :
EXCEPTION_CONTINUE_SEARCH) {
            x = 7;
        }
    } __finally {
    ++x;
    }
    return x;
}

-- 
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/20161020/133b5e8f/attachment.html>


More information about the llvm-bugs mailing list