summaryrefslogtreecommitdiff
path: root/parse/export.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-01-14 13:25:47 -0800
committerOri Bernstein <ori@eigenstate.org>2018-01-14 13:46:18 -0800
commite7ebda38777e5251b3479c3fdced4cb108f252e4 (patch)
tree79f4c82d261879baa7a13cced78c3c0b67e25c1b /parse/export.c
parent8a53929e91acf351a11ec717c726833b2c703be1 (diff)
downloadmc-e7ebda38777e5251b3479c3fdced4cb108f252e4.tar.gz
Fix serializing trait specs in usefiles.
Diffstat (limited to 'parse/export.c')
-rw-r--r--parse/export.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/parse/export.c b/parse/export.c
index 68733fa..2d6e075 100644
--- a/parse/export.c
+++ b/parse/export.c
@@ -71,11 +71,15 @@ tagtype(Stab *st, Type *t, int ingeneric, int hidelocal)
{
size_t i;
- if (t->vis != Visintern)
+ if (!t || t->vis != Visintern)
return;
t->vis = Vishidden;
for (i = 0; i < t->nsub; i++)
tagtype(st, t->sub[i], ingeneric, hidelocal);
+ for (i = 0; i < t->nspec; i++) {
+ tagtype(st, t->spec[i]->param, ingeneric, hidelocal);
+ tagtype(st, t->spec[i]->aux, ingeneric, hidelocal);
+ }
switch (t->type) {
case Tystruct:
for (i = 0; i < t->nmemb; i++)
@@ -259,16 +263,18 @@ tagexports(int hidelocal)
free(k);
/* tag the traits */
- tr = NULL;
for (i = 0; i < ntraittab; i++) {
tr = traittab[i];
if (tr->vis != Visexport)
continue;
if (hidelocal && tr->ishidden)
tr->vis = Vishidden;
+ tagtype(st, tr->param, 0, hidelocal);
tr->param->vis = tr->vis;
- for (j = 0; j < tr->naux; j++)
+ for (j = 0; j < tr->naux; j++) {
+ tagtype(st, tr->aux[j], 0, hidelocal);
tr->aux[j]->vis = tr->vis;
+ }
for (j = 0; j < tr->nproto; j++) {
tr->proto[j]->decl.vis = tr->vis;
tagnode(st, tr->proto[j], 0, hidelocal);