Skip to content

clang-cl -EHa doesn't generate calls to @llvm.seh.try.end #62723

Open
@efriedma-quic

Description

Consider the following:

int volatile *NullPtr = 0;
void foo(), bar();
void baz() {
  try {
    try {
    } catch(...) {
      foo();
      __builtin_unreachable();
    }
    *NullPtr = 0;
  } catch (...) {
    bar();
  }
}
void baz2() {
  try {
    try {
      *NullPtr = 0;
    } catch(...) {
      foo();
      __builtin_unreachable();
    }
  } catch (...) {
    bar();
  }
}

baz() and baz2() currently lower to exactly the same code; that seems unlikely to be correct.

https://godbolt.org/z/f9odrKGEf

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions