Get messages working again.

This commit is contained in:
Bill Currie 2011-01-10 11:40:15 +09:00
parent 9e06220dc5
commit d327c860cb
2 changed files with 5 additions and 11 deletions

View file

@ -728,7 +728,7 @@ class_pointer_def (class_t *class)
class_type.c.class = class; class_type.c.class = class;
def = get_def (class->type, def = get_def (pointer_type (class->type),
va ("_OBJ_CLASS_POINTER_%s", class->name), va ("_OBJ_CLASS_POINTER_%s", class->name),
pr.scope, st_static); pr.scope, st_static);
if (def->initialized) if (def->initialized)
@ -792,7 +792,7 @@ class_finish_module (void)
symtab_def->nosave = 1; symtab_def->nosave = 1;
symtab = &G_STRUCT (pr_symtab_t, symtab_def->ofs); symtab = &G_STRUCT (pr_symtab_t, symtab_def->ofs);
if (selector_table_def) { if (selector_table_def) {
symtab->sel_ref_cnt = selector_table_def->type->t.func.num_params; symtab->sel_ref_cnt = selector_table_def->type->t.array.size;
EMIT_DEF (symtab->refs, selector_table_def); EMIT_DEF (symtab->refs, selector_table_def);
} }
symtab->cls_def_cnt = num_classes; symtab->cls_def_cnt = num_classes;

View file

@ -2836,21 +2836,15 @@ message_expr (expr_t *receiver, keywordarg_t *message)
if (receiver->type == ex_error) if (receiver->type == ex_error)
return receiver; return receiver;
if (!(rec_type->type == ev_pointer if (rec_type->type != ev_pointer
&& is_class (rec_type->t.fldptr.type)) || !is_class (rec_type->t.fldptr.type))
&& !is_class (rec_type))
return error (receiver, "not a class/object"); return error (receiver, "not a class/object");
if (self) { if (self) {
class = extract_class (current_class); class = extract_class (current_class);
if (rec_type == &type_Class) if (rec_type == &type_Class)
class_msg = 1; class_msg = 1;
} else { } else {
if (is_class (rec_type)) { class = rec_type->t.fldptr.type->t.class;
class = rec_type->t.class;
receiver = address_expr (receiver, 0, 0);
} else {
class = rec_type->t.fldptr.type->t.class;
}
} }
} }