forked from OSchip/llvm-project
Fix crash on complex constant zero.
Fixes <rdar://problem/14442543>. llvm-svn: 186452
This commit is contained in:
parent
c97d83dd3b
commit
64f2391899
|
@ -114,9 +114,9 @@ public:
|
|||
if (result.isReference())
|
||||
return EmitLoadOfLValue(result.getReferenceLValue(CGF, E));
|
||||
|
||||
llvm::ConstantStruct *pair =
|
||||
cast<llvm::ConstantStruct>(result.getValue());
|
||||
return ComplexPairTy(pair->getOperand(0), pair->getOperand(1));
|
||||
llvm::Constant *pair = result.getValue();
|
||||
return ComplexPairTy(pair->getAggregateElement(0U),
|
||||
pair->getAggregateElement(1U));
|
||||
}
|
||||
return EmitLoadOfLValue(E);
|
||||
}
|
||||
|
|
|
@ -95,3 +95,6 @@ double t7(double _Complex c) {
|
|||
void t8() {
|
||||
__complex__ int *x = &(__complex__ int){1};
|
||||
}
|
||||
|
||||
const _Complex double test9const = 0;
|
||||
_Complex double test9func() { return test9const; }
|
||||
|
|
Loading…
Reference in New Issue