summaryrefslogtreecommitdiff
path: root/src/cmd/6l/pass.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/6l/pass.c')
-rw-r--r--src/cmd/6l/pass.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/cmd/6l/pass.c b/src/cmd/6l/pass.c
index 8fda94392..0b0ee1253 100644
--- a/src/cmd/6l/pass.c
+++ b/src/cmd/6l/pass.c
@@ -274,10 +274,10 @@ patch(void)
if(HEADTYPE == Hwindows) {
// Windows
// Convert
- // op n(GS), reg
+ // op n(GS), reg
// to
// MOVL 0x58(GS), reg
- // op n(reg), reg
+ // op n(reg), reg
// The purpose of this patch is to fix some accesses
// to extern register variables (TLS) on Windows, as
// a different method is used to access them.
@@ -674,6 +674,11 @@ dostkoff(void)
p->spadj = -autoffset;
p = appendp(p);
p->as = ARET;
+ // If there are instructions following
+ // this ARET, they come from a branch
+ // with the same stackframe, so undo
+ // the cleanup.
+ p->spadj = +autoffset;
}
}
}