diff options
author | Dan Gohman <gohman@apple.com> | 2008-09-08 16:45:59 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-09-08 16:45:59 +0000 |
commit | 500233aef94a5ea910efcd171ddf54e59b939ace (patch) | |
tree | 33e8ab3b4ceb564a61534e4af746613311fb7289 /lib/VMCore/Verifier.cpp | |
parent | f91570c264344532e456feec232155e969caf82f (diff) | |
download | external_llvm-500233aef94a5ea910efcd171ddf54e59b939ace.zip external_llvm-500233aef94a5ea910efcd171ddf54e59b939ace.tar.gz external_llvm-500233aef94a5ea910efcd171ddf54e59b939ace.tar.bz2 |
Bitcasting two or from aggregate types is not permitted. Update
LangRef.html, and teach the verifier to check bitcast instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55921 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Verifier.cpp')
-rw-r--r-- | lib/VMCore/Verifier.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index aa6963d..805fb25 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -883,6 +883,12 @@ void Verifier::visitBitCastInst(BitCastInst &I) { "Bitcast requires both operands to be pointer or neither", &I); Assert1(SrcBitSize == DestBitSize, "Bitcast requies types of same width", &I); + // Disallow aggregates. + Assert1(!SrcTy->isAggregateType(), + "Bitcast operand must not be aggregate", &I); + Assert1(!DestTy->isAggregateType(), + "Bitcast type must not be aggregate", &I); + visitInstruction(I); } |