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 | |
| parent | a6e29a60e56f492175fa2f70df61dbdaaff98b2a (diff) | |
20090217-1118
| -rw-r--r-- | CHANGES | 3 | ||||
| -rw-r--r-- | appl/cmd/limbo/stubs.b | 8 | ||||
| -rw-r--r-- | dis/limbo.dis | bin | 343321 -> 343383 bytes | |||
| -rw-r--r-- | include/version.h | 2 | ||||
| -rw-r--r-- | limbo/stubs.c | 8 |
5 files changed, 14 insertions, 7 deletions
@@ -1,3 +1,6 @@ +20090217 + appl/cmd/limbo/stubs.b limbo/stubs.c - include length parameter to builtinmod (could just be 0 in most cases) + change f->ret/destroy code in stubs.c/stubs.b to destroy correctly in case of exceptions 20090202 emu/port/win-x11a.c: might as well try this everywhere now 20090127 diff --git a/appl/cmd/limbo/stubs.b b/appl/cmd/limbo/stubs.b index cafd6ff7..28b92a13 100644 --- a/appl/cmd/limbo/stubs.b +++ b/appl/cmd/limbo/stubs.b @@ -142,7 +142,7 @@ modcode(globals: ref Decl) 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){ @@ -173,8 +173,10 @@ modcode(globals: ref Decl) 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"); } diff --git a/dis/limbo.dis b/dis/limbo.dis Binary files differindex 8abc6333..3e835b96 100644 --- a/dis/limbo.dis +++ b/dis/limbo.dis diff --git a/include/version.h b/include/version.h index 606ad1e2..54f3a53c 100644 --- a/include/version.h +++ b/include/version.h @@ -1 +1 @@ -#define VERSION "Fourth Edition (20090202)" +#define VERSION "Fourth Edition (20090217)" 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"); } |
