summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprComplex.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-02-14 01:48:17 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-02-14 01:48:17 +0000
commit212af641f2b71dbc372b3cfb283b332116c68b26 (patch)
treeb79898a5b0d2e64f247809db17b4f7ed53658a9b /lib/CodeGen/CGExprComplex.cpp
parent1fc307f60cc61c65138624c49a702ac572acad45 (diff)
downloadclang-212af641f2b71dbc372b3cfb283b332116c68b26.tar.gz
CodeGen: _Atomic(_Complex) shouldn't crash
We could be a little kinder if we did a compare-exchange loop instead of an atomic-load/store pair. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229212 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprComplex.cpp')
-rw-r--r--lib/CodeGen/CGExprComplex.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp
index 1fea5a127c..e0ac08b1aa 100644
--- a/lib/CodeGen/CGExprComplex.cpp
+++ b/lib/CodeGen/CGExprComplex.cpp
@@ -820,6 +820,8 @@ EmitCompoundAssignLValue(const CompoundAssignOperator *E,
TestAndClearIgnoreReal();
TestAndClearIgnoreImag();
QualType LHSTy = E->getLHS()->getType();
+ if (const AtomicType *AT = LHSTy->getAs<AtomicType>())
+ LHSTy = AT->getValueType();
BinOpInfo OpInfo;