diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-07-05 14:21:36 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-07-05 14:21:36 +0000 | 
| commit | 1a82d4c088707c791c792f6822f611b47a12bdfe (patch) | |
| tree | 7c411f9b5d807f7f204fdd16965d8925a82b6d18 /lib/Transforms/Instrumentation/SafeStack.cpp | |
| parent | 3a0822f094b578157263e04114075ad7df81db41 (diff) | |
Notes
Diffstat (limited to 'lib/Transforms/Instrumentation/SafeStack.cpp')
| -rw-r--r-- | lib/Transforms/Instrumentation/SafeStack.cpp | 7 | 
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Transforms/Instrumentation/SafeStack.cpp b/lib/Transforms/Instrumentation/SafeStack.cpp index 13c541218313..6b185a2b127b 100644 --- a/lib/Transforms/Instrumentation/SafeStack.cpp +++ b/lib/Transforms/Instrumentation/SafeStack.cpp @@ -165,7 +165,7 @@ class SafeStack : public FunctionPass {    Type *Int32Ty;    Type *Int8Ty; -  Constant *UnsafeStackPtr; +  Constant *UnsafeStackPtr = nullptr;    /// Unsafe stack alignment. Each stack frame must ensure that the stack is    /// aligned to this value. We need to re-align the unsafe stack if the @@ -232,8 +232,6 @@ public:      Int32Ty = Type::getInt32Ty(M.getContext());      Int8Ty = Type::getInt8Ty(M.getContext()); -    UnsafeStackPtr = getOrCreateUnsafeStackPtr(M); -      return false;    } @@ -576,6 +574,9 @@ bool SafeStack::runOnFunction(Function &F) {    if (!StackRestorePoints.empty())      ++NumUnsafeStackRestorePointsFunctions; +  if (!UnsafeStackPtr) +    UnsafeStackPtr = getOrCreateUnsafeStackPtr(*F.getParent()); +    // The top of the unsafe stack after all unsafe static allocas are allocated.    Value *StaticTop = moveStaticAllocasToUnsafeStack(F, StaticAllocas, Returns);  | 
