mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-04-01 12:43:47 +00:00
[Sema] Check __builtin_bit_cast operand for completeness before materializing it.
This shouldn't be observable, but it doesn't make sense to materialize an incomplete type. llvm-svn: 368610
This commit is contained in:
parent
0761a38e8a
commit
055fcec78c
@ -2799,9 +2799,6 @@ void CastOperation::CheckCStyleCast() {
|
||||
|
||||
void CastOperation::CheckBuiltinBitCast() {
|
||||
QualType SrcType = SrcExpr.get()->getType();
|
||||
if (SrcExpr.get()->isRValue())
|
||||
SrcExpr = Self.CreateMaterializeTemporaryExpr(SrcType, SrcExpr.get(),
|
||||
/*IsLValueReference=*/false);
|
||||
|
||||
if (Self.RequireCompleteType(OpRange.getBegin(), DestType,
|
||||
diag::err_typecheck_cast_to_incomplete) ||
|
||||
@ -2811,6 +2808,10 @@ void CastOperation::CheckBuiltinBitCast() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (SrcExpr.get()->isRValue())
|
||||
SrcExpr = Self.CreateMaterializeTemporaryExpr(SrcType, SrcExpr.get(),
|
||||
/*IsLValueReference=*/false);
|
||||
|
||||
CharUnits DestSize = Self.Context.getTypeSizeInChars(DestType);
|
||||
CharUnits SourceSize = Self.Context.getTypeSizeInChars(SrcType);
|
||||
if (DestSize != SourceSize) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user