ref: 2d53920a0c348a285c20d87360ed7457afdb1478
parent: 8cc199bcdeb207351248b0450e1e6a7114507b47
author: Ori Bernstein <[email protected]>
date: Mon May 19 19:23:48 EDT 2014
Use the correct sybmol writing function to write.
--- a/parse/use.c
+++ b/parse/use.c
@@ -508,7 +508,7 @@
wrtype(fd, n->impl.type);
wrint(fd, n->impl.ndecls);
for (i = 0; i < n->impl.ndecls; i++)
- pickle(fd, n->impl.decls[i]);
+ wrsym(fd, n->impl.decls[i]);
break;
case Nnone:
die("Nnone should not be seen as node type!");
@@ -644,12 +644,13 @@
break;
case Nimpl:
n->impl.traitname = unpickle(fd);
- n->impl.trait = htget(trmap, (void*)rdint(fd));
+ i = rdint(fd);
+ n->impl.trait = htget(trmap, (void*)i);
rdtype(fd, &n->impl.type);
n->impl.ndecls = rdint(fd);
n->impl.decls = zalloc(sizeof(Node *)*n->impl.ndecls);
for (i = 0; i < n->impl.ndecls; i++)
- n->impl.decls[i] = unpickle(fd);
+ n->impl.decls[i] = rdsym(fd, NULL);
break;
case Nnone:
die("Nnone should not be seen as node type!");
@@ -809,6 +810,9 @@
case 'I':
impl = unpickle(f);
putimpl(s, impl);
+ /* specialized declarations always go into the global stab */
+ for (i = 0; i < impl->impl.ndecls; i++)
+ putimpl(file->file.globls, impl->impl.decls[i]);
break;
case EOF:
break;