summaryrefslogtreecommitdiff
path: root/mi
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-03-08 19:59:55 -0700
committerOri Bernstein <ori@eigenstate.org>2015-03-08 19:59:55 -0700
commita3b2adffd9eeb3d15e54cfcba7b1f1097ade002d (patch)
tree38993a1a7e85217b8c3e0d84a12aa28fdc98a750 /mi
parentfa136ee5b99cfcca3384a849578d168392ff2865 (diff)
downloadmc-a3b2adffd9eeb3d15e54cfcba7b1f1097ade002d.tar.gz
Add 'tygeneric' specifier.
Diffstat (limited to 'mi')
-rw-r--r--mi/match.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/mi/match.c b/mi/match.c
index f80e40e..0ba3f2c 100644
--- a/mi/match.c
+++ b/mi/match.c
@@ -43,9 +43,14 @@ void dtdump(Dtree *dt, FILE *f);
* out of memory, etc) long before getting to this code if we actually had that
* many branches of the switch statements anyways.
*/
-static size_t nconstructors(Type *t) { if (!t) return 0; t = tybase(t); switch
-(t->type) { case Tyvoid: return 0; break;
+static size_t nconstructors(Type *t)
+{
+ if (!t)
+ return 0;
+ t = tybase(t);
+ switch (t->type) {
+ case Tyvoid: return 0; break;
case Tybool: return 2; break;
case Tychar: return 0x10ffff; break;
@@ -79,7 +84,7 @@ static size_t nconstructors(Type *t) { if (!t) return 0; t = tybase(t); switch
case Tyunion: return t->nmemb; break;
case Tyslice: return ~0ULL; break;
case Tyvar: case Typaram: case Tyunres: case Tyname:
- case Tybad: case Tyvalist: case Ntypes:
+ case Tybad: case Tyvalist: case Tygeneric: case Ntypes:
die("Invalid constructor type %s in match", tystr(t));
break;
}