ref: 245116529d23936eb8da6537359e5467e064baab
parent: 4ceb01e5c364b6273cc58bd79a1563e39307d818
author: Ori Bernstein <[email protected]>
date: Fri Jun 8 10:29:33 EDT 2012
Don't try to set constraints on Ntypes. It's not a real type. We need to ignore it.
--- a/parse/type.c
+++ b/parse/type.c
@@ -23,7 +23,7 @@
Cstr **cstrtab;
int ncstrs;
-static Cstr *tycstrs[Ntypes][4];
+static Cstr *tycstrs[Ntypes + 1][4];
Type *mkty(int line, Ty ty)
{
@@ -463,11 +463,13 @@
/* Definining and registering the types has to go after we define the
* constraints, otherwise they will have no constraints set on them. */
-#define Ty(t, n) {\
- ty = mkty(-1, t); \
- if (n) { \
- puttype(st, mkname(-1, n), ty); \
- }}
+#define Ty(t, n) \
+ if (t != Ntypes) {\
+ ty = mkty(-1, t); \
+ if (n) { \
+ puttype(st, mkname(-1, n), ty); \
+ } \
+ }
#include "types.def"
#undef Ty