Fixed bug in loading categories.

main
theraven 16 years ago
parent b2bc15c64e
commit 29790da51c

@ -579,10 +579,11 @@ static void merge_methods_from_superclass (Class class)
if (dtable == __objc_uninstalled_dtable) { return; } if (dtable == __objc_uninstalled_dtable) { return; }
do do
{ {
MethodList_t method_list = class->methods; MethodList_t method_list = super->methods;
while (method_list) while (method_list)
{ {
int i; int i;
struct sarray *super_dtable = dtable_for_class(super);
/* Search the method list. */ /* Search the method list. */
for (i = 0; i < method_list->method_count; ++i) for (i = 0; i < method_list->method_count; ++i)
@ -596,7 +597,7 @@ static void merge_methods_from_superclass (Class class)
// the slot pointer into this dtable. // the slot pointer into this dtable.
if (NULL == slot) if (NULL == slot)
{ {
slot = sarray_get_safe(dtable_for_class(super), sel_id); slot = sarray_get_safe(super_dtable, sel_id);
// If slot is NULL here, something has gone badly wrong with // If slot is NULL here, something has gone badly wrong with
// the superclass already. // the superclass already.
sarray_at_put_safe (dtable, sel_id, slot); sarray_at_put_safe (dtable, sel_id, slot);

Loading…
Cancel
Save