From 5a13d4d2c1e45ab611ca857d923caacfaeb3cd07 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Fri, 24 Feb 2012 23:53:49 +0000 Subject: Fix a stupid mistake in r151133. Reported to me by Joerg Sonnenberger. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151407 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExprAgg.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/CodeGen/CGExprAgg.cpp') diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp index 6ea21ec47a..d620d3b953 100644 --- a/lib/CodeGen/CGExprAgg.cpp +++ b/lib/CodeGen/CGExprAgg.cpp @@ -857,10 +857,12 @@ void AggExprEmitter::EmitNullInitializationToLValue(LValue lv) { llvm::Value *null = llvm::Constant::getNullValue(CGF.ConvertType(type)); // Note that the following is not equivalent to // EmitStoreThroughBitfieldLValue for ARC types. - if (lv.isBitField()) + if (lv.isBitField()) { CGF.EmitStoreThroughBitfieldLValue(RValue::get(null), lv); - assert(lv.isSimple()); - CGF.EmitStoreOfScalar(null, lv, /* isInitialization */ true); + } else { + assert(lv.isSimple()); + CGF.EmitStoreOfScalar(null, lv, /* isInitialization */ true); + } } else { // There's a potential optimization opportunity in combining // memsets; that would be easy for arrays, but relatively -- cgit v1.2.3