aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/CGObjCGNU.cpp1
-rw-r--r--lib/CodeGen/CGObjCMac.cpp2
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp
index 2bbb15f017..b5cd36061f 100644
--- a/lib/CodeGen/CGObjCGNU.cpp
+++ b/lib/CodeGen/CGObjCGNU.cpp
@@ -1086,6 +1086,7 @@ LValue CGObjCGNU::EmitObjCValueForIvar(CodeGen::CodeGenFunction &CGF,
const ObjCIvarDecl *Ivar,
const FieldDecl *Field,
unsigned CVRQualifiers) {
+ assert(Field == ObjectTy->getAsObjCInterfaceType()->getDecl()->lookupFieldDeclForIvar(CGM.getContext(), Ivar));
if (Ivar->isBitField())
return CGF.EmitLValueForBitfield(BaseValue, const_cast<FieldDecl *>(Field),
CVRQualifiers);
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index d1623075d5..3b5e0c5504 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -2368,6 +2368,7 @@ LValue CGObjCMac::EmitObjCValueForIvar(CodeGen::CodeGenFunction &CGF,
const ObjCIvarDecl *Ivar,
const FieldDecl *Field,
unsigned CVRQualifiers) {
+ assert(Field == ObjectTy->getAsObjCInterfaceType()->getDecl()->lookupFieldDeclForIvar(CGM.getContext(), Ivar));
if (Ivar->isBitField())
return CGF.EmitLValueForBitfield(BaseValue, const_cast<FieldDecl *>(Field),
CVRQualifiers);
@@ -4888,6 +4889,7 @@ LValue CGObjCNonFragileABIMac::EmitObjCValueForIvar(
const ObjCIvarDecl *Ivar,
const FieldDecl *Field,
unsigned CVRQualifiers) {
+ assert(Field == ObjectTy->getAsObjCInterfaceType()->getDecl()->lookupFieldDeclForIvar(CGM.getContext(), Ivar));
assert(ObjectTy->isObjCInterfaceType() &&
"CGObjCNonFragileABIMac::EmitObjCValueForIvar");
ObjCInterfaceDecl *ID = ObjectTy->getAsObjCInterfaceType()->getDecl();