shithub: mc

Download patch

ref: b80fae534ed816fc3fe8c03e26e1b43f542d5cf6
parent: 5c5abaeddf4ec4551e0616e3000f1afaca35bf72
author: Ori Bernstein <[email protected]>
date: Thu Dec 18 18:39:02 EST 2014

Fix type equality/hashing for unresolved types.

--- a/parse/type.c
+++ b/parse/type.c
@@ -638,6 +638,7 @@
         case Tyvar:     hash = inthash(t->tid);         break;
         case Tyunion:   hash = inthash(t->tid);         break;
         case Tystruct:  hash = inthash(t->tid);         break;
+        case Tyname:    hash = namehash(t->name);       break;
         default:        hash = inthash(t->type);        break;
     }
 
@@ -691,6 +692,9 @@
             if (a->tid != b->tid)
                 return 0;
             break;
+        case Tyunres:
+            if (!nameeq(a->name, b->name))
+                return 0;
         case Tyunion:
             for (i = 0; i < a->nmemb; i++) {
                 if (!nameeq(a->udecls[i]->name, b->udecls[i]->name))