diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2012-10-11 02:05:23 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2012-10-11 02:05:23 +0000 |
commit | 5e01f80bf85b9a68352d4c146caa9ddcf6af6dcf (patch) | |
tree | ebe8bc0c8e44eace3c7765aa2a4509813222f515 /lib/Transforms/InstCombine | |
parent | e0297196edbe6539e7d3269fa19f84e04dd0a9cd (diff) | |
download | external_llvm-5e01f80bf85b9a68352d4c146caa9ddcf6af6dcf.zip external_llvm-5e01f80bf85b9a68352d4c146caa9ddcf6af6dcf.tar.gz external_llvm-5e01f80bf85b9a68352d4c146caa9ddcf6af6dcf.tar.bz2 |
Don't crash when !tbaa.struct contents is invalid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165693 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine')
-rw-r--r-- | lib/Transforms/InstCombine/InstCombineCalls.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineCalls.cpp b/lib/Transforms/InstCombine/InstCombineCalls.cpp index f92c4ba..04b7b21 100644 --- a/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -111,10 +111,13 @@ Instruction *InstCombiner::SimplifyMemTransfer(MemIntrinsic *MI) { // get the TBAA tag describing our copy. if (MDNode *M = MI->getMetadata(LLVMContext::MD_tbaa_struct)) { if (M->getNumOperands() == 3 && + M->getOperand(0) && isa<ConstantInt>(M->getOperand(0)) && cast<ConstantInt>(M->getOperand(0))->isNullValue() && + M->getOperand(1) && isa<ConstantInt>(M->getOperand(1)) && cast<ConstantInt>(M->getOperand(1))->getValue() == Size && + M->getOperand(2) && isa<MDNode>(M->getOperand(2))) CopyMD = cast<MDNode>(M->getOperand(2)); } |