Fix code gen bug generating code for
((id)cat)->isa. Fixes radar 7709015. llvm-svn: 97672
This commit is contained in:
parent
aabec2fb84
commit
281aae6328
|
@ -1888,6 +1888,8 @@ LValue CodeGenFunction::EmitObjCIsaExpr(const ObjCIsaExpr *E) {
|
|||
V = CreateTempAlloca(ClassPtrTy, "resval");
|
||||
llvm::Value *Src = EmitScalarExpr(BaseExpr);
|
||||
Builder.CreateStore(Src, V);
|
||||
LValue LV = LValue::MakeAddr(V, MakeQualifiers(E->getType()));
|
||||
V = ScalarExprEmitter(*this).EmitLoadOfLValue(LV, E->getType());
|
||||
}
|
||||
else {
|
||||
if (E->isArrow())
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -emit-llvm -o %t %s
|
||||
// RUN: %clang_cc1 -emit-llvm -o - %s
|
||||
|
||||
typedef struct objc_class *Class;
|
||||
|
||||
|
@ -48,3 +48,19 @@ id Test2() {
|
|||
return (*[Foo method]).isa;
|
||||
return [Foo method]->isa;
|
||||
}
|
||||
|
||||
// rdar 7709015
|
||||
@interface Cat {}
|
||||
@end
|
||||
|
||||
@interface SuperCat : Cat {}
|
||||
+(void)geneticallyAlterCat:(Cat *)cat;
|
||||
@end
|
||||
|
||||
@implementation SuperCat
|
||||
+ (void)geneticallyAlterCat:(Cat *)cat {
|
||||
Class dynamicSubclass;
|
||||
((id)cat)->isa = dynamicSubclass;
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
Loading…
Reference in New Issue