Skip to content

Commit 05718cc

Browse files
minux4ad
authored andcommitted
cmd/7g: fix ginscall for defers
Fixes golang#112.
1 parent 26c8fb8 commit 05718cc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cmd/7g/ggen.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,9 @@ ginscall(Node *f, int proc)
253253
}
254254

255255
if(proc == 2) {
256-
nodreg(&reg, types[TINT64], D_R0+REGRT1);
256+
nodreg(&reg, types[TINT64], D_R0); // R0 should match runtime.return0
257257
p = gins(ACMP, &reg, N);
258-
p->reg = D_R0;
258+
p->reg = REGZERO;
259259
p = gbranch(ABEQ, T, +1);
260260
cgen_ret(N);
261261
patch(p, pc);

0 commit comments

Comments
 (0)