[PATCH] D99630: phase 01: add new command line flag to enable UAR in 3 modes (always, [runtime], never).

Kevin Athey via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 19 13:43:51 PDT 2021


kda abandoned this revision.
kda added a comment.

will attempt in smaller pieces.



================
Comment at: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:3317
                          ConstantInt::get(IntptrTy, LocalStackSize));
-    IRB.SetInsertPoint(InsBefore);
-    FakeStack = createPHI(IRB, UseAfterReturnIsEnabled, FakeStackValue, Term,
-                          ConstantInt::get(IntptrTy, 0));
-
-    Value *NoFakeStack =
-        IRB.CreateICmpEQ(FakeStack, Constant::getNullValue(IntptrTy));
-    Term = SplitBlockAndInsertIfThen(NoFakeStack, InsBefore, false);
-    IRBIf.SetInsertPoint(Term);
-    Value *AllocaValue =
-        DoDynamicAlloca ? createAllocaForLayout(IRBIf, L, true) : StaticAlloca;
-
-    IRB.SetInsertPoint(InsBefore);
-    LocalStackBase = createPHI(IRB, NoFakeStack, AllocaValue, Term, FakeStack);
-    IRB.CreateStore(LocalStackBase, LocalStackBaseAlloca);
-    DIExprFlags |= DIExpression::DerefBefore;
+      IRB.SetInsertPoint(InsBefore);
+      PHINode *FakeStack = IRB.CreatePHI(IntptrTy, 1);
----------------
I think this is where things start going wrong, but after a few hours looking, I'm not sure what the code should look like.
I know I don't want a branch, but I don't know how to just stick the call in to the stack allocator.
I think once that is right, then the pieces after it follow in a straightforwad manner.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99630/new/

https://reviews.llvm.org/D99630



More information about the cfe-commits mailing list