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 | c05dca95a21825dc10fd788781d64a585e347767 (patch) | |
| tree | f0549569b036794d2b963df5abc19e0d2b06ab10 /llvm/lib | |
| parent | fd18d630bc65840c151fcf87754fc7173027a28c (diff) | |
| download | bcm5719-llvm-c05dca95a21825dc10fd788781d64a585e347767.tar.gz bcm5719-llvm-c05dca95a21825dc10fd788781d64a585e347767.zip | |
Bitcasting two or from aggregate types is not permitted. Update
LangRef.html, and teach the verifier to check bitcast instructions.
llvm-svn: 55921
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/VMCore/Verifier.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp index aa6963d94a2..805fb2564a4 100644 --- a/llvm/lib/VMCore/Verifier.cpp +++ b/llvm/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); } |

