[qfcc] Treat null method return type as id

This prevents a segfault when the method's return type is undefined.
This commit is contained in:
Bill Currie 2020-07-04 12:39:11 +09:00
parent e4ee5c70e0
commit f544a6f0b0

View file

@ -89,6 +89,10 @@ new_method (type_t *ret_type, param_t *selector, param_t *opt_params)
dstring_t *name = dstring_newstr ();
dstring_t *types = dstring_newstr ();
if (!ret_type) {
ret_type = &type_id;
}
selector = reverse_params (selector);
selector = append_params (selector, opt_params);
cmd->next = selector;