summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2013-05-27 13:49:50 -0400
committerOri Bernstein <ori@eigenstate.org>2013-05-27 13:49:50 -0400
commite2f62755339d913f59d08ceafaa24849cf9da803 (patch)
tree8bb78a4686c934400a65bfb11942f550fd2f061e
parent77a37e3330f03b9f1a9c45810994d94c921b45ae (diff)
downloadmc-e2f62755339d913f59d08ceafaa24849cf9da803.tar.gz
Insert symbols into the right symbol table.
-rw-r--r--libstd/Makefile1
-rw-r--r--parse/use.c4
-rw-r--r--test/import-type.myr9
-rw-r--r--test/tests1
4 files changed, 13 insertions, 2 deletions
diff --git a/libstd/Makefile b/libstd/Makefile
index 3482cab..78cdb01 100644
--- a/libstd/Makefile
+++ b/libstd/Makefile
@@ -8,6 +8,7 @@ MYRSRC= \
optparse.myr \
rand.myr \
slappend.myr \
+ sleq.myr \
slurp.myr \
sys.myr \
types.myr \
diff --git a/parse/use.c b/parse/use.c
index 28a3596..68704ae 100644
--- a/parse/use.c
+++ b/parse/use.c
@@ -629,8 +629,8 @@ int loaduse(FILE *f, Stab *st)
htput(tidmap, (void*)tid, t);
/* fix up types */
if (t->type == Tyname || t->type == Tygeneric)
- if (!gettype(st, t->name))
- puttype(st, t->name, t);
+ if (!gettype(s, t->name))
+ puttype(s, t->name, t);
/*
u = tybase(t);
if (u->type == Tyunion) {
diff --git a/test/import-type.myr b/test/import-type.myr
new file mode 100644
index 0000000..ab13d3b
--- /dev/null
+++ b/test/import-type.myr
@@ -0,0 +1,9 @@
+use std
+
+const main = {
+ var x : std.size
+ var y : std.off
+ var z : std.statbuf
+
+ -> 0
+}
diff --git a/test/tests b/test/tests
index e15c9f6..33cbd2b 100644
--- a/test/tests
+++ b/test/tests
@@ -81,6 +81,7 @@ B helloworld P Hello-世界
B catfile P Hello-世界
B encodechar P 1世界äa
B exportcycle E 0
+B import-type E 0
F declmismatch
F infermismatch
# F usedef ## BUGGERED