[qfcc] Fix ivar visibility

It was broken by the big rewrite and I forgot to fix it.
This commit is contained in:
Bill Currie 2020-03-03 10:42:05 +09:00
parent 50d39d64cb
commit 16223098e5
2 changed files with 5 additions and 1 deletions

View File

@ -1202,8 +1202,9 @@ field_expr (expr_t *e1, expr_t *e2)
class_t *class = t1->t.fldptr.type->t.class;
symbol_t *sym = e2->e.symbol;//FIXME need to check
symbol_t *ivar;
int protected = class_access (current_class, class);
ivar = class_find_ivar (class, vis_protected, sym->name);
ivar = class_find_ivar (class, protected, sym->name);
if (!ivar)
return new_error_expr ();
e2->type = ex_value;

View File

@ -706,6 +706,7 @@ struct_decl
$1->type = append_type ($1->type, $<spec>0.type);
$1->type = find_type ($1->type);
$1->sy_type = sy_var;
$1->visibility = current_visibility;
symtab_addsymbol (current_symtab, $1);
}
| var_decl
@ -715,6 +716,7 @@ struct_decl
$1->type = append_type ($1->type, $<spec>0.type);
$1->type = find_type ($1->type);
$1->sy_type = sy_var;
$1->visibility = current_visibility;
symtab_addsymbol (current_symtab, $1);
}
| var_decl ':' expr %prec COMMA {}
@ -1762,6 +1764,7 @@ ivar_decl_list
tab = $$->parent; // preserve the ivars inheritance chain
build_struct ('s', 0, $$, 0);
$$->parent = tab;
current_visibility = vis_public;
}
;