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())
|
if (result.isReference())
|
||||||
return EmitLoadOfLValue(result.getReferenceLValue(CGF, E));
|
return EmitLoadOfLValue(result.getReferenceLValue(CGF, E));
|
||||||
|
|
||||||
llvm::ConstantStruct *pair =
|
llvm::Constant *pair = result.getValue();
|
||||||
cast<llvm::ConstantStruct>(result.getValue());
|
return ComplexPairTy(pair->getAggregateElement(0U),
|
||||||
return ComplexPairTy(pair->getOperand(0), pair->getOperand(1));
|
pair->getAggregateElement(1U));
|
||||||
}
|
}
|
||||||
return EmitLoadOfLValue(E);
|
return EmitLoadOfLValue(E);
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,3 +95,6 @@ double t7(double _Complex c) {
|
||||||
void t8() {
|
void t8() {
|
||||||
__complex__ int *x = &(__complex__ int){1};
|
__complex__ int *x = &(__complex__ int){1};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const _Complex double test9const = 0;
|
||||||
|
_Complex double test9func() { return test9const; }
|
||||||
|
|
Loading…
Reference in New Issue