aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/6g/gsubr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/6g/gsubr.c')
-rw-r--r--src/cmd/6g/gsubr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cmd/6g/gsubr.c b/src/cmd/6g/gsubr.c
index f224dfd9f2..78b8c4351c 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);