From d632dee9cb93ec0e45e070207046742019464d55 Mon Sep 17 00:00:00 2001 From: Ziemowit Laski Date: Mon, 26 Aug 2002 21:17:20 +0000 Subject: objc-act.c (get_super_receiver): If inside a class method of a category... [gcc] 2002-08-26 Ziemowit Laski * objc/objc-act.c (get_super_receiver): If inside a class method of a category, cast the receiver to 'id' before accessing the 'isa' field so that is not needed. For NeXT runtime. [gcc/testsuite] 2002-08-26 Ziemowit Laski * objc.dg/super-class-2.m: New test. From-SVN: r56587 --- gcc/objc/objc-act.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gcc/objc') diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index e1c630d6..0819369 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -7042,9 +7042,13 @@ get_super_receiver () { super_class = get_class_reference (super_name); if (TREE_CODE (objc_method_context) == CLASS_METHOD_DECL) + /* Cast the super class to 'id', since the user may not have + included , leaving 'struct objc_class' + an incomplete type. */ super_class - = build_component_ref (build_indirect_ref (super_class, "->"), - get_identifier ("isa")); + = build_component_ref (build_indirect_ref + (build_c_cast (id_type, super_class), "->"), + get_identifier ("isa")); } else { -- cgit v1.1