diff options
author | Chris Lattner <sabre@nondot.org> | 2008-08-23 05:31:10 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-08-23 05:31:10 +0000 |
commit | 259f88e3c9dc2fe0513897d8a4d3b05adf2eea46 (patch) | |
tree | 33d4ec06430a66dcff5a64d452d53a68cf2ff20e /lib/VMCore/Verifier.cpp | |
parent | dbf7aa5b4bb2b8bbeaf7c53d03d2ab222feba7c3 (diff) | |
download | external_llvm-259f88e3c9dc2fe0513897d8a4d3b05adf2eea46.zip external_llvm-259f88e3c9dc2fe0513897d8a4d3b05adf2eea46.tar.gz external_llvm-259f88e3c9dc2fe0513897d8a4d3b05adf2eea46.tar.bz2 |
Verify that the alignment argument to llvm.memcpy is a constant
integer, PR2318.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55228 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Verifier.cpp')
-rw-r--r-- | lib/VMCore/Verifier.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index bede405..e569011 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -1273,6 +1273,16 @@ void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) { switch (ID) { default: break; + case Intrinsic::memcpy_i32: + case Intrinsic::memcpy_i64: + case Intrinsic::memmove_i32: + case Intrinsic::memmove_i64: + case Intrinsic::memset_i32: + case Intrinsic::memset_i64: + Assert1(isa<ConstantInt>(CI.getOperand(4)), + "alignment argument of memory intrinsics must be a constant int", + &CI); + break; case Intrinsic::init_trampoline: Assert1(isa<Function>(CI.getOperand(2)->stripPointerCasts()), "llvm.init_trampoline parameter #2 must resolve to a function.", |