summaryrefslogtreecommitdiff
path: root/parse
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-07-29 22:46:53 -0700
committerOri Bernstein <ori@eigenstate.org>2017-07-29 22:47:45 -0700
commit093716ff5e2ffe837793ba7c9239c64e22789ec0 (patch)
treed8935dcc85b96e378e7497dc6343ba6a80cd6ba0 /parse
parent6f2fe6bc22f5baeec9feb049cc434fb32e64c8ed (diff)
downloadmc-093716ff5e2ffe837793ba7c9239c64e22789ec0.tar.gz
Don't use tyhash for scoping.
Soon enough, it's going to use a strict equality comparison, so that params from different scopes will be considered different. It's a step towards deduping.
Diffstat (limited to 'parse')
-rw-r--r--parse/stab.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/parse/stab.c b/parse/stab.c
index 4cdee28..7e7e968 100644
--- a/parse/stab.c
+++ b/parse/stab.c
@@ -116,6 +116,18 @@ popstab()
stabstkoff--;
}
+ulong
+paramhash(void *p)
+{
+ return strhash(((Type*)p)->pname);
+}
+
+int
+parameq(void *a, void *b)
+{
+ return streq(((Type*)a)->pname, ((Type*)b)->pname);
+}
+
Tyenv*
mkenv()
{
@@ -123,7 +135,7 @@ mkenv()
e = malloc(sizeof(Tyenv));
e->super = NULL;
- e->tab = mkht(tyhash, tyeq);
+ e->tab = mkht(paramhash, parameq);
return e;
}