aboutsummaryrefslogtreecommitdiff
path: root/semantics.c
diff options
context:
space:
mode:
Diffstat (limited to 'semantics.c')
-rw-r--r--semantics.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/semantics.c b/semantics.c
index 285538e..49a782d 100644
--- a/semantics.c
+++ b/semantics.c
@@ -261,6 +261,7 @@ CVar_t cvar_create(char *name, CType_t type, CNode *ast) {
cv->type = type;
cv->ast = ast;
cv->defsite = NULL;
+ cv->global = 0;
return cv;
}
@@ -1890,6 +1891,7 @@ void semantics_check(CNode *p) {
CVList_t nv = NEW(CVList);
nv->var = tp->rec.var;
nv->next = gvars;
+ nv->var->global = 1;
gvars = nv;
}
}