summaryrefslogtreecommitdiff
path: root/clang/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
commitce27e42d47bbc136cf1deb1859e10e9e8da5b501 (patch)
tree5bf1477b9df72f1650174d916ab4a5138f8b5bdd /clang/lib/CodeGen/CGExprComplex.cpp
parent7ddf832e0e35f8c461711ae4fedb3590e85b2525 (diff)
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. llvm-svn: 229212
Diffstat (limited to 'clang/lib/CodeGen/CGExprComplex.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprComplex.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGExprComplex.cpp b/clang/lib/CodeGen/CGExprComplex.cpp
index 1fea5a127c09..e0ac08b1aa6d 100644
--- a/clang/lib/CodeGen/CGExprComplex.cpp
+++ b/clang/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;