brintos

brintos / llvm-project-archived public Read only

0
0
Text · 691 B · bbaeef7 Raw
23 lines · c
1// RUN: %clang_hwasan -g %s -o %t && not %run %t 2>&1 | FileCheck %s2 3// Dynamic stack realignment causes debug info locations to use non-FP-relative4// offsets because stack frames are realigned below FP, which means that we5// can't associate addresses with stack objects in this case. Ideally we should6// be able to handle this case somehow (e.g. by using a different register for7// DW_AT_frame_base) but at least we shouldn't get confused by it.8 9// REQUIRES: pointer-tagging10 11__attribute((noinline))12char *buggy() {13  _Alignas(64) char c[64];14  char *volatile p = c;15  return p;16}17 18int main() {19  char *p = buggy();20  // CHECK-NOT: Potentially referenced stack objects:21  p[0] = 0;22}23