[qfcc] Catch deferences to incomplete types

Reporting an error is so much more helpful than segmentation fault.
This commit is contained in:
Bill Currie 2020-03-01 17:43:28 +09:00
parent 277c64a460
commit b544321609

View file

@ -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)