ref: cec2ed10f355e59322f3d148837dca47aab083a6
parent: 1e6724ebb8fcf53876cd280efd2bf63c51c3f834
author: Ori Bernstein <ori@eigenstate.org>
date: Wed May 8 03:32:27 EDT 2019
Fix thing scorrectly.
--- 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 @@
{
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);
--- a/parse/parse.h
+++ b/parse/parse.h
@@ -169,6 +169,7 @@
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? */
};