ref: eb57aeb9187aed368d1f8cb83383e4b6dffbe7fa
parent: cfb191b44373a070f378a6655a69214cf6dbda9b
author: Ori Bernstein <[email protected]>
date: Tue Dec 24 19:03:25 EST 2013
Balance the bind()/unbind() calls.
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -319,7 +319,7 @@
size_t i;
t = tysearch(st, orig);
- st->ingeneric += t->isgeneric;
+ st->ingeneric += orig->isgeneric;
tyresolve(st, t);
/* If this is an instantiation of a generic type, we want the params to
* match the instantiation */
@@ -331,7 +331,7 @@
t->isgeneric = 1;
}
}
- st->ingeneric -= t->isgeneric;
+ st->ingeneric -= orig->isgeneric;
return t;
}
@@ -500,7 +500,6 @@
return;
htfree(st->tybindings[st->ntybindings - 1]);
lpop(&st->tybindings, &st->ntybindings);
- st->ingeneric--;
}
/* Constrains a type to implement the required constraints. On