llvm-project/libunwind
Florian Mayer a3153381af [libunwind] Handle G in personality string
Tested with the following program:

```
static volatile int* x = nullptr;

void throws()  __attribute__((noinline)) {
  if (getpid() == 0)
    return;
  throw "error";
}

void maybe_throws()  __attribute__((noinline)) {
  volatile int y = 1;
  x = &y;
  throws();
  y = 2;
}

int main(int argc, char** argv) {
  int y;
  try {
    maybe_throws();
  } catch (const char* e) {
    //printf("Caught\n");
  }
  y = *x;
  printf("%d\n", y); // should be MTE failure.
  return 0;
}
```

Built using `clang++ -c -O2 -target aarch64-linux -fexceptions -march=armv8-a+memtag -fsanitize=memtag-heap,memtag-stack`

Currently only Android implements runtime support for MTE stack tagging.

Without this change, we crash on `__cxa_get_globals` when trying to catch
the exception (because the stack frame __cxa_get_globals frame will fail due
to tags left behind on the stack). With this change, we crash on the `y = *x;`
as expected, because the stack frame has been untagged, but the pointer hasn't.

Reviewed By: #libunwind, compnerd, MaskRay

Differential Revision: https://reviews.llvm.org/D128998
2022-09-21 14:13:32 -07:00
..
cmake [compiler-rt][libunwind][runtimes] Recategorize `llvm_check_linker_flag` langs 2022-08-17 12:35:36 -04:00
docs [libunwind] Fixed a number of typos 2022-08-20 18:09:03 -07:00
include [libunwind] Fixed a number of typos 2022-08-20 18:09:03 -07:00
src [libunwind] Handle G in personality string 2022-09-21 14:13:32 -07:00
test [libunwind] Fixed a number of typos 2022-08-20 18:09:03 -07:00
.clang-format
CMakeLists.txt Revert "[cmake] Use `CMAKE_INSTALL_LIBDIR` too" 2022-08-18 22:46:32 -04:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00