forked from OSchip/llvm-project
[CGCall] Check store type in findDominatingStoreToReturnValue()
We need to make sure that the stored type matches the return type.
This commit is contained in:
parent
b24b56165a
commit
b72fd1a84d
|
@ -3228,7 +3228,8 @@ static llvm::StoreInst *findDominatingStoreToReturnValue(CodeGenFunction &CGF) {
|
|||
// ReturnValue to some other location.
|
||||
auto GetStoreIfValid = [&CGF](llvm::User *U) -> llvm::StoreInst * {
|
||||
auto *SI = dyn_cast<llvm::StoreInst>(U);
|
||||
if (!SI || SI->getPointerOperand() != CGF.ReturnValue.getPointer())
|
||||
if (!SI || SI->getPointerOperand() != CGF.ReturnValue.getPointer() ||
|
||||
SI->getValueOperand()->getType() != CGF.ReturnValue.getElementType())
|
||||
return nullptr;
|
||||
// These aren't actually possible for non-coerced returns, and we
|
||||
// only care about non-coerced returns on this code path.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -no-opaque-pointers -triple thumbv7--windows-itanium -fdeclspec -fobjc-runtime=ios -emit-llvm -o - %s -Wno-objc-root-class | FileCheck %s
|
||||
// RUN: %clang_cc1 -triple thumbv7--windows-itanium -fdeclspec -fobjc-runtime=ios -emit-llvm -o - %s -Wno-objc-root-class | FileCheck %s
|
||||
|
||||
@protocol Protocol
|
||||
- (void) protocol_method;
|
||||
|
|
Loading…
Reference in New Issue