exits successfully lol

This commit is contained in:
2026-06-12 13:28:10 -06:00
parent 30e73fcba1
commit c051b402dd
11 changed files with 38 additions and 19 deletions

View File

@@ -602,7 +602,8 @@ seljmp(Blk *b, Fn *fn)
if (b->jmp.type == Jret0
|| b->jmp.type == Jjmp
|| b->jmp.type == Jhlt)
|| b->jmp.type == Jhlt
|| b->jmp.type == Jtail)
return;
assert(b->jmp.type == Jjnz);
r = b->jmp.arg;

View File

@@ -167,7 +167,7 @@ argsclass(Ins *i0, Ins *i1, AClass *ac, int op, AClass *aret, Ref *env)
nsse = 8;
varc = 0;
envc = 0;
for (i=i0, a=ac; i<i1; i++, a++)
for (i=i0, a=ac; i<i1; i++, a++) {
switch (i->op - op + Oarg) {
case Oarg:
if (KBASE(i->cls) == 0)
@@ -211,8 +211,9 @@ argsclass(Ins *i0, Ins *i1, AClass *ac, int op, AClass *aret, Ref *env)
varc = 1;
break;
default:
die("unreachable");
die("218 unreachable");
}
}
if (varc && envc)
err("sysv abi does not support variadic env calls");
@@ -686,7 +687,7 @@ amd64_sysv_abi(Fn *fn)
continue;
curi = &insb[NIns];
selret(b, fn);
for (i=&b->ins[b->nins]; i!=b->ins;)
for (i=&b->ins[b->nins]; i!=b->ins;) {
switch ((--i)->op) {
default:
emiti(*i);
@@ -706,8 +707,13 @@ amd64_sysv_abi(Fn *fn)
break;
case Oarg:
case Oargc:
die("unreachable");
if (b->jmp.type != Jtail) {
die("710 unreachable");
} else {
}
}
}
if (b == fn->start)
for (; ral; ral=ral->link)
emiti(ral->i);