diff options
| author | Charles.Forsyth <devnull@localhost> | 2009-02-17 11:18:45 +0000 |
|---|---|---|
| committer | Charles.Forsyth <devnull@localhost> | 2009-02-17 11:18:45 +0000 |
| commit | 12ac827e529ef6383a8bf5d1b171f5009b669a43 (patch) | |
| tree | adf3680883f13d5bbb3d4b9c0b74d2f2eff615af /limbo | |
| parent | a6e29a60e56f492175fa2f70df61dbdaaff98b2a (diff) | |
20090217-1118
Diffstat (limited to 'limbo')
| -rw-r--r-- | limbo/stubs.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/limbo/stubs.c b/limbo/stubs.c index 7d951c63..ca6db284 100644 --- a/limbo/stubs.c +++ b/limbo/stubs.c @@ -113,7 +113,7 @@ modcode(Decl *globals) print("\nvoid\n%sinit(void)\n{\n", emitcode); else{ print("\nvoid\n%smodinit(void)\n{\n", emitcode); - print("\tbuiltinmod(\"$%s\", %smodtab);\n", emitcode, emitcode); + print("\tbuiltinmod(\"$%s\", %smodtab, %smodlen);\n", emitcode, emitcode, emitcode); } for(id = d->ty->ids; id != nil; id = id->next){ if(id->store == Dtype && id->ty->kind == Tadt){ @@ -145,8 +145,10 @@ modcode(Decl *globals) print("\nvoid\n%s_%s(void *fp)\n{\n\tF_%s_%s *f = fp;\n", id->dot->sym->name, id->sym->name, id->dot->sym->name, id->sym->name); - if(id->ty->tof != tnone && tattr[id->ty->tof->kind].isptr) - print("\n\tdestroy(*f->ret);\n\t*f->ret = H;\n"); + if(id->ty->tof != tnone && tattr[id->ty->tof->kind].isptr){ + print("\tvoid *r;\n"); + print("\n\tr = *f->ret;\n\t*f->ret = H;\n\tdestroy(r);\n"); + } print("}\n"); } |
