brintos

brintos / llvm-project-archived public Read only

0
0
Text · 520 B · 1c63bb9 Raw
29 lines · cpp
1// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -O0 %s -o %t && %run %t %p2 3// PR17377: C++ module destructors get stale argument shadow.4 5#include <stdio.h>6#include <stdlib.h>7class A {8public:9  // This destructor get stale argument shadow left from the call to f().10  ~A() {11    if (this)12      exit(0);13  }14};15 16A a;17 18__attribute__((noinline))19void f(long x) {20}21 22int main(void) {23  long  x;24  long * volatile p = &x;25  // This call poisons TLS shadow for the first function argument.26  f(*p);27  return 0;28}29