File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
compiler-rt/test/hwasan/TestCases
llvm/lib/Transforms/Instrumentation Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: %clangxx_hwasan -mllvm -hwasan-use-stack-safety=0 %s -o %t
2
+ // RUN: %run %t
3
+ //
4
+ // REQUIRES: pointer-tagging
5
+
6
+ __attribute__ ((noinline)) int bar(int X) { return X; }
7
+
8
+ __attribute__ ((noinline)) int foo(int X) {
9
+ volatile int A = 5 ;
10
+ [[clang::musttail]] return bar (X + A);
11
+ }
12
+
13
+ int main (int Argc, char *Argv[]) { return foo (Argc) != 6 ; }
Original file line number Diff line number Diff line change @@ -1531,9 +1531,14 @@ bool HWAddressSanitizer::sanitizeFunction(
1531
1531
}
1532
1532
}
1533
1533
1534
- if (isa<ReturnInst>(Inst) || isa<ResumeInst>(Inst) ||
1535
- isa<CleanupReturnInst>(Inst))
1534
+ if (isa<ReturnInst>(Inst)) {
1535
+ if (CallInst *CI = Inst.getParent ()->getTerminatingMustTailCall ())
1536
+ RetVec.push_back (CI);
1537
+ else
1538
+ RetVec.push_back (&Inst);
1539
+ } else if (isa<ResumeInst, CleanupReturnInst>(Inst)) {
1536
1540
RetVec.push_back (&Inst);
1541
+ }
1537
1542
1538
1543
if (auto *DVI = dyn_cast<DbgVariableIntrinsic>(&Inst)) {
1539
1544
for (Value *V : DVI->location_ops ()) {
You can’t perform that action at this time.
0 commit comments