From a919e5f6198d28273ba9fb7f0a2853bd055c6177 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 20 Mar 2011 13:33:42 +0900 Subject: [PATCH] Make class_check_ivars() use class_add_ivars() to add the ivars. This avoids implementation ivar blocks trashing the ivar offsets in derived classes. --- tools/qfcc/source/class.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/qfcc/source/class.c b/tools/qfcc/source/class.c index 6568be20b..06ad377ca 100644 --- a/tools/qfcc/source/class.c +++ b/tools/qfcc/source/class.c @@ -928,23 +928,23 @@ void class_check_ivars (class_t *class, symtab_t *ivars) { symbol_t *civ, *iv; + int missmatch = 0; - if (!class->ivars != !ivars) - goto missmatch; - if (ivars) { + if (!class->ivars != !ivars) { + missmatch = 1; + } else if (ivars) { for (civ = class->ivars->symbols, iv = ivars->symbols; civ && iv; civ = civ->next, iv = iv->next) { - if (!compare_symbols (civ, iv)) - goto missmatch; + if (!compare_symbols (civ, iv)) { + missmatch = 1; + break; + } } } - class->ivars = ivars; - return; -missmatch: //FIXME right option? - if (options.warnings.interface_check) + if (missmatch && options.warnings.interface_check) warning (0, "instance variable missmatch for %s", class->name); - class->ivars = ivars; + class_add_ivars (class, ivars); } category_t *