summaryrefslogtreecommitdiff
path: root/parse/use.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-10-21 19:49:23 -0700
committerOri Bernstein <ori@eigenstate.org>2017-10-21 19:56:13 -0700
commitd4862853ca810b97d1adc2944f32975fd4a5018f (patch)
tree11ece02b233083f4cd4d7da8ae9f773e74229980 /parse/use.c
parentb7cd6588a862680434445e53f27125e43d76a4af (diff)
downloadmc-d4862853ca810b97d1adc2944f32975fd4a5018f.tar.gz
Don't bungle trait merging and exporting.
Diffstat (limited to 'parse/use.c')
-rw-r--r--parse/use.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/parse/use.c b/parse/use.c
index d446503..b25e914 100644
--- a/parse/use.c
+++ b/parse/use.c
@@ -1168,6 +1168,7 @@ writeuse(FILE *f, Node *file)
{
Stab *st;
void **k;
+ Trait *tr;
Node *s, *u;
size_t i, n;
@@ -1211,14 +1212,17 @@ writeuse(FILE *f, Node *file)
}
}
- for (i = 0; i < ntraittab; i++) {
- if (i < Ntraits || i != traittab[i]->uid)
+ k = htkeys(st->tr, &n);
+ for (i = 0; i < n; i++) {
+ tr = gettrait(st, k[i]);
+ if (tr->uid < Ntraits)
continue;
- if (traittab[i]->vis == Visexport || traittab[i]->vis == Vishidden) {
+ if (tr->vis == Visexport || tr->vis == Vishidden) {
wrbyte(f, 'R');
- traitpickle(f, traittab[i]);
+ traitpickle(f, tr);
}
}
+ free(k);
k = htkeys(st->impl, &n);
for (i = 0; i < n; i++) {