ref: ec9b1cfee38a882f64cecd3dbe17f5361e655ae4
parent: 1a06a63131eff54522020c2ed5f7801d55a0c8e7
author: Ori Bernstein <[email protected]>
date: Sun Aug 26 19:55:01 EDT 2012
Fix dumping namespaces. We were using the wrong key type.
--- a/parse/dump.c
+++ b/parse/dump.c
@@ -92,8 +92,8 @@
k = htkeys(st->ns, &n);
for (i = 0; i < n; i++) {
indent(fd, depth + 1);
- fprintf(fd, "N %s\n", namestr(k[i]));
- outstab(getns(st, k[i]), fd, depth + 1);
+ fprintf(fd, "N %s\n", (char*)k[i]);
+ outstab(getns_str(st, k[i]), fd, depth + 1);
}
free(k);
}
--- a/parse/type.c
+++ b/parse/type.c
@@ -249,6 +249,7 @@
Type *tybase(Type *t)
{
+ assert(t != NULL);
while (t->type == Tyname)
t = t->sub[0];
return t;