shithub: mc

Download patch

ref: 01d8745d2634852770f029e3e6624f3417e8bc98
parent: 528ac41dc8b1b23ce8a22fee1c296bbe9a6742cc
author: Ori Bernstein <ori@markovcorp.com>
date: Wed Jul 4 06:33:28 EDT 2018

Fix infinite recursion in type inference.

--- a/parse/infer.c
+++ b/parse/infer.c
@@ -120,9 +120,9 @@
 
 	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);