mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-20 18:52:28 +00:00
[qfcc] Catch deferences to incomplete types
Reporting an error is so much more helpful than segmentation fault.
This commit is contained in:
parent
277c64a460
commit
b544321609
1 changed files with 4 additions and 0 deletions
|
@ -889,6 +889,10 @@ class_find_ivar (class_t *class, int vis, const char *name)
|
|||
{
|
||||
symbol_t *ivar;
|
||||
|
||||
if (!class->ivars) {
|
||||
error (0, "accessing incomplete type %s", class->name);
|
||||
return 0;
|
||||
}
|
||||
ivar = symtab_lookup (class->ivars, name);
|
||||
if (ivar) {
|
||||
if (ivar->visibility > (vis_t) vis)
|
||||
|
|
Loading…
Reference in a new issue