aboutsummaryrefslogtreecommitdiff
path: root/semantics.c
diff options
context:
space:
mode:
authorTeddy <[email protected]>2014-04-29 15:17:40 +0800
committerTeddy <[email protected]>2014-04-29 15:17:40 +0800
commit9ae0ff9fdd9266a6fdf2e463e58204f050a02589 (patch)
treea757cb82cd2a4fe7a690af7f20645701fa265f1b /semantics.c
parent1d0cb4a804fd276a9f768680f59ecd4642066e28 (diff)
...
Diffstat (limited to 'semantics.c')
-rw-r--r--semantics.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/semantics.c b/semantics.c
index 4545303..5af8761 100644
--- a/semantics.c
+++ b/semantics.c
@@ -126,8 +126,7 @@ void *ctable_lookup(CTable_t ct, const char *key) {
int ctable_insert(CTable_t ct, const char *key, void *val, int lvl) {
unsigned int hv = ct->hfunc(key) % MAX_TABLE_SIZE;
- CTNode *p = ct->head[hv];
- CTNode *np;
+ CTNode *p = ct->head[hv], *np;
for (; p && p->lvl == lvl; p = p->next)
if (!strcmp(p->key, key))
return 0; /* conflict */
@@ -261,6 +260,7 @@ CVar_t cvar_create(char *name, CType_t type, CNode *ast) {
cv->name = name;
cv->type = type;
cv->ast = ast;
+ cv->defsite = NULL;
return cv;
}