From 5a5a7b5163112d74bd8700b1ba39808e802f67b8 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 16 Jun 2011 01:25:49 -0400 Subject: [PATCH] 6g, 8g: fix goto fix R=ken2 CC=golang-dev https://golang.org/cl/4632041 --- src/cmd/6g/gsubr.c | 5 ++++- src/cmd/8g/gsubr.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/cmd/6g/gsubr.c b/src/cmd/6g/gsubr.c index 66dac11859..49d66e0833 100644 --- a/src/cmd/6g/gsubr.c +++ b/src/cmd/6g/gsubr.c @@ -125,7 +125,7 @@ clearstk(void) { Plist *pl; Prog *p1, *p2; - Node sp, di, cx, con; + Node sp, di, cx, con, ax; if((uint32)plast->firstpc->to.offset <= 0) return; @@ -147,6 +147,9 @@ clearstk(void) gins(ACLD, N, N); gins(AMOVQ, &sp, &di); gins(AMOVQ, &con, &cx); + nodconst(&con, types[TUINT64], 0); + nodreg(&ax, types[TUINT64], D_AX); + gins(AMOVQ, &con, &ax); gins(AREP, N, N); gins(ASTOSQ, N, N); diff --git a/src/cmd/8g/gsubr.c b/src/cmd/8g/gsubr.c index d0c7310251..a8d65cf22f 100644 --- a/src/cmd/8g/gsubr.c +++ b/src/cmd/8g/gsubr.c @@ -127,7 +127,7 @@ clearstk(void) { Plist *pl; Prog *p1, *p2; - Node sp, di, cx, con; + Node sp, di, cx, con, ax; if(plast->firstpc->to.offset <= 0) return; @@ -149,6 +149,9 @@ clearstk(void) gins(ACLD, N, N); gins(AMOVL, &sp, &di); gins(AMOVL, &con, &cx); + nodconst(&con, types[TUINT32], 0); + nodreg(&ax, types[TUINT32], D_AX); + gins(AMOVL, &con, &ax); gins(AREP, N, N); gins(ASTOSL, N, N);