Fixed typo in comment in runtime.c.

Fixed unsafe dtable access in message lookup.
main
theraven 16 years ago
parent d770ed9688
commit d4fe4f522e

@ -439,7 +439,7 @@ BOOL
class_respondsToSelector(Class cls, SEL sel) class_respondsToSelector(Class cls, SEL sel)
{ {
/* Warning the __objc_responds_to() function expects an id argument and /* Warning the __objc_responds_to() function expects an id argument and
* dereferences the initial ivar (the 'isa' pointer) to fidn the class. * dereferences the initial ivar (the 'isa' pointer) to find the class.
*/ */
return __objc_responds_to((id)&cls, sel); return __objc_responds_to((id)&cls, sel);
} }

@ -47,8 +47,9 @@ Slot_t objc_msg_lookup_internal(id *receiver, SEL selector, id sender)
{ {
// Check again incase another thread updated the dtable while we // Check again incase another thread updated the dtable while we
// weren't looking // weren't looking
result = sarray_get_safe((*receiver)->class_pointer->dtable, result =
(sidx)selector->sel_id); sarray_get_safe(dtable_for_class((*receiver)->class_pointer),
(sidx)selector->sel_id);
} }
if (0 == result) if (0 == result)
{ {

Loading…
Cancel
Save