summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2019-05-08 07:32:27 -0700
committerOri Bernstein <ori@eigenstate.org>2019-05-08 07:32:27 -0700
commitcec2ed10f355e59322f3d148837dca47aab083a6 (patch)
tree63204bf88196e41815fe63b219c118bb4298b2f9
parent1e6724ebb8fcf53876cd280efd2bf63c51c3f834 (diff)
downloadmc-cec2ed10f355e59322f3d148837dca47aab083a6.tar.gz
Fix thing scorrectly.
-rw-r--r--parse/export.c7
-rw-r--r--parse/parse.h1
2 files changed, 5 insertions, 3 deletions
diff --git a/parse/export.c b/parse/export.c
index f907ceb..fb7b05f 100644
--- a/parse/export.c
+++ b/parse/export.c
@@ -15,8 +15,8 @@
#include "util.h"
#include "parse.h"
-static void tagtype(Stab *st, Type *t, int ingeneric, int hidelocal);
static void tagnode(Stab *st, Node *n, int ingeneric, int hidelocal);
+static void tagtype(Stab *st, Type *t, int ingeneric, int hidelocal);
void
tagreflect(Type *t)
@@ -71,9 +71,10 @@ tagtype(Stab *st, Type *t, int ingeneric, int hidelocal)
{
size_t i;
- if (!t || t->vis != Visintern)
+ if (!t || t->tagged)
return;
- t->vis = Vishidden;
+ t->tagged = 1;
+ t->vis = (t->vis == Visintern) ? Vishidden : t->vis;
tagtype(st, t->seqaux, ingeneric, hidelocal);
for (i = 0; i < t->nsub; i++)
tagtype(st, t->sub[i], ingeneric, hidelocal);
diff --git a/parse/parse.h b/parse/parse.h
index 619f9d6..4fbbfa7 100644
--- a/parse/parse.h
+++ b/parse/parse.h
@@ -169,6 +169,7 @@ struct Type {
char isemitted; /* Tyname: whether this type has been emitted */
char resolved; /* Have we resolved the subtypes? Prevents infinite recursion. */
char fixed; /* Have we fixed the subtypes? Prevents infinite recursion. */
+ char tagged; /* Have we tagged the type for export? */
};