diff options
author | Nuno Lopes <nunoplopes@sapo.pt> | 2012-08-01 16:58:51 +0000 |
---|---|---|
committer | Nuno Lopes <nunoplopes@sapo.pt> | 2012-08-01 16:58:51 +0000 |
commit | 28ad863f6c00baa3ace5ca3f0f6a1fdc52197d8e (patch) | |
tree | a8e488e5b916b8132ed94ef3c4b2a98ff6cf2112 /lib/Transforms | |
parent | b705e4a8b69bd9936bdc0b114a193dc0bae2db85 (diff) | |
download | external_llvm-28ad863f6c00baa3ace5ca3f0f6a1fdc52197d8e.zip external_llvm-28ad863f6c00baa3ace5ca3f0f6a1fdc52197d8e.tar.gz external_llvm-28ad863f6c00baa3ace5ca3f0f6a1fdc52197d8e.tar.bz2 |
(hopefuly) fix the remaining cases where null wasnt expected (PR13497).
I'll commit a test to the clang tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161118 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Utils/BuildLibCalls.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/Utils/BuildLibCalls.cpp b/lib/Transforms/Utils/BuildLibCalls.cpp index 1ebd5b7..89949bb 100644 --- a/lib/Transforms/Utils/BuildLibCalls.cpp +++ b/lib/Transforms/Utils/BuildLibCalls.cpp @@ -526,6 +526,8 @@ bool SimplifyFortifiedLibCalls::fold(CallInst *CI, const TargetData *TD, if (isFoldable(2, 1, true)) { Value *Ret = EmitStrCpy(CI->getArgOperand(0), CI->getArgOperand(1), B, TD, TLI, Name.substr(2, 6)); + if (!Ret) + return false; replaceCall(Ret); return true; } @@ -545,6 +547,8 @@ bool SimplifyFortifiedLibCalls::fold(CallInst *CI, const TargetData *TD, Value *Ret = EmitStrNCpy(CI->getArgOperand(0), CI->getArgOperand(1), CI->getArgOperand(2), B, TD, TLI, Name.substr(2, 7)); + if (!Ret) + return false; replaceCall(Ret); return true; } |