mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
Treat messages to id and Class separately.
As id and Class do not point to real objects as such, trying to get the class from their types doesn't work, so instead send the message to a "null" class that skips the method checks.
This commit is contained in:
parent
ee28f3869c
commit
96110a0f54
2 changed files with 16 additions and 13 deletions
|
@ -761,7 +761,7 @@ class_message_response (class_t *class, int class_msg, expr_t *sel)
|
|||
selector = get_selector (sel);
|
||||
if (!selector)
|
||||
return 0;
|
||||
if (class->type != &type_obj_object) {
|
||||
if (class && class->type != &type_obj_object) {
|
||||
while (c) {
|
||||
for (cat = c->categories; cat; cat = cat->next) {
|
||||
for (m = cat->methods->head; m; m = m->next) {
|
||||
|
|
|
@ -2828,19 +2828,22 @@ message_expr (expr_t *receiver, keywordarg_t *message)
|
|||
if (receiver->type == ex_error)
|
||||
return receiver;
|
||||
|
||||
if (rec_type->type == ev_pointer)
|
||||
rec_type = rec_type->t.fldptr.type;
|
||||
if (!is_class (rec_type))
|
||||
return error (receiver, "not a class/object");
|
||||
|
||||
if (self) {
|
||||
if (!class)
|
||||
class = extract_class (current_class);
|
||||
if (rec_type == &type_obj_class)
|
||||
class_msg = 1;
|
||||
if (rec_type == &type_id || rec_type == &type_Class) {
|
||||
} else {
|
||||
if (!class)
|
||||
class = rec_type->t.class;
|
||||
if (rec_type->type == ev_pointer)
|
||||
rec_type = rec_type->t.fldptr.type;
|
||||
if (!is_class (rec_type))
|
||||
return error (receiver, "not a class/object");
|
||||
|
||||
if (self) {
|
||||
if (!class)
|
||||
class = extract_class (current_class);
|
||||
if (rec_type == &type_obj_class)
|
||||
class_msg = 1;
|
||||
} else {
|
||||
if (!class)
|
||||
class = rec_type->t.class;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue