mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-22 18:31:27 +00:00
give an error message instead of segging for the following code:
@class foo; @interface bar : foo @end
This commit is contained in:
parent
fade4419f7
commit
35d690c701
1 changed files with 10 additions and 3 deletions
|
@ -506,9 +506,16 @@ struct_t *
|
|||
class_new_ivars (class_t *class)
|
||||
{
|
||||
struct_t *ivars = new_struct (0);
|
||||
if (class->super_class)
|
||||
new_struct_field (ivars, class->super_class->ivars->type, 0,
|
||||
vis_private);
|
||||
if (class->super_class) {
|
||||
if (!class->super_class->ivars) {
|
||||
error (0, "cannot find interface declaration for `%s', "
|
||||
"superclass of `%s'", class->super_class->name,
|
||||
class->name);
|
||||
} else {
|
||||
new_struct_field (ivars, class->super_class->ivars->type, 0,
|
||||
vis_private);
|
||||
}
|
||||
}
|
||||
return ivars;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue