summaryrefslogtreecommitdiff
path: root/parse/infer.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@markovcorp.com>2018-07-04 10:33:28 -0700
committerOri Bernstein <ori@markovcorp.com>2018-07-04 10:33:49 -0700
commit01d8745d2634852770f029e3e6624f3417e8bc98 (patch)
tree6a19e437fc4f7e81fed3650f4d9ed51408d8e25c /parse/infer.c
parent528ac41dc8b1b23ce8a22fee1c296bbe9a6742cc (diff)
downloadmc-01d8745d2634852770f029e3e6624f3417e8bc98.tar.gz
Fix infinite recursion in type inference.
Diffstat (limited to 'parse/infer.c')
-rw-r--r--parse/infer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/parse/infer.c b/parse/infer.c
index 808a485..c5cad2f 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -120,9 +120,9 @@ nodetystr(Node *n)
t = NULL;
if (n->type == Nexpr && exprtype(n) != NULL)
- t = tyfix(n, exprtype(n), 1);
+ t = tysearch(exprtype(n));
else if (n->type == Ndecl && decltype(n) != NULL)
- t = tyfix(n, decltype(n), 1);
+ t = tysearch(decltype(n));
if (t && tybase(t)->type != Tyvar)
return tystr(t);