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

            Bug ID: 25162
           Summary: [WinEH] cleanuppad funclets for C++ EH cannot catch
                    exceptions
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangb...@nondot.org
          Reporter: r...@google.com
                CC: david.majne...@gmail.com, llvm-bugs@lists.llvm.org
    Classification: Unclassified

Consider this example:

extern "C" int puts(const char *);
struct HasDtor {
  /*__forceinline*/ ~HasDtor() {
    try {
      throw 2;
    } catch (int) {
      puts("catch ~HasDtor");
    }
  }
};
int main() {
  try {
    HasDtor o;
    throw 1;
  } catch (int) {
    puts("catch main");
  }
}

clang-cl can compile and run this as expected with the __forceinline commented
out, but uncommenting it makes the program call std::terminate at runtime.

Right now our C++ cleanup funclets don't have pointers to cppxdata. It's not
clear to me if we can make cleanup funclets just like catch handlers here,
where the cleanup funclet references the parent xdata table. If we can do that,
then this will be easy.

If cleanup funclets need their own xdata tables, then we have to change things
up a bit.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to