Fix the bogus declarations of obj_msgSend and obj_msgSend_super.

This commit is contained in:
Bill Currie 2011-03-02 12:35:10 +09:00
parent fda46a4aca
commit bfeece3255
2 changed files with 6 additions and 14 deletions

View file

@ -246,15 +246,10 @@ resolve_external_def (defref_t *ext, defref_t *def)
linker_type_mismatch (REF (ext), REF (def)); linker_type_mismatch (REF (ext), REF (def));
return; return;
} }
if (def->space != ext->space) {
//FIXME this is here until I fix the main cause of problems:
//mishandling of obj_msgSend and obj_msgSend_super.
def_warning (REF (def), "help, help!");
def_warning (REF (ext), "I'm being relocated!");
}
REF (ext)->offset = REF (def)->offset; REF (ext)->offset = REF (def)->offset;
REF (ext)->flags = REF (def)->flags; REF (ext)->flags = REF (def)->flags;
ext->merge = 1; ext->merge = 1;
ext->space = def->space;
ext->next = def->merge_list; ext->next = def->merge_list;
def->merge_list = ext; def->merge_list = ext;
} }
@ -280,17 +275,11 @@ process_def (defref_t *ref, qfo_mspace_t *space)
} else if (def->flags & QFOD_GLOBAL) { } else if (def->flags & QFOD_GLOBAL) {
if (r) { if (r) {
if (REF (r)->flags & QFOD_SYSTEM) { if (REF (r)->flags & QFOD_SYSTEM) {
if (def->type != REF (r)->type) {
linker_type_mismatch (def, REF (r));
return;
}
/// System defs may be redefined only once. /// System defs may be redefined only once.
REF (r)->flags &= ~QFOD_SYSTEM; REF (r)->flags &= ~QFOD_SYSTEM;
if (ref->space != r->space) // treat the new def as external
internal_error (0, "help, help!"); resolve_external_def (ref, r);
//FIXME copy stuff from new def to existing def??? //FIXME copy stuff from new def to existing def???
def->offset = REF(r)->offset;
def->flags = REF(r)->flags;
} else { } else {
def_error (def, "%s redefined", WORKSTR (def->name)); def_error (def, "%s redefined", WORKSTR (def->name));
def_error (REF (r), "previous definition"); def_error (REF (r), "previous definition");

View file

@ -263,9 +263,12 @@ send_message (int super)
} }
sym = symtab_lookup (pr.symtab, sm_name); sym = symtab_lookup (pr.symtab, sm_name);
if (!sym) { if (!sym) {
symtab_t *save = current_symtab;
current_symtab = pr.symtab;
sym = new_symbol_type (sm_name, sm_type); sym = new_symbol_type (sm_name, sm_type);
sym = function_symbol (sym, 0, 1); sym = function_symbol (sym, 0, 1);
make_function (sym, 0, sym->table->space, st_extern); make_function (sym, 0, sym->table->space, st_extern);
current_symtab = save;
} }
return new_symbol_expr (sym); return new_symbol_expr (sym);
} }