Skip to content

Commit 3952057

Browse files
committed
cmd/compile: align arm64 stack frames correctly
If the compiler doesn't do it, cmd/internal/obj/arm64 will, and that will break the zeroing of ambiguously live values done in zerorange, which in turn produces uninitialized pointer cells that the GC trips over. For #9880. Change-Id: Ice97c30bc8b36d06b7b88d778d87fab8e1827fdc Reviewed-on: https://go-review.googlesource.com/12847 Reviewed-by: Austin Clements <[email protected]>
1 parent 23e4744 commit 3952057

File tree

1 file changed

+7
-0
lines changed
  • src/cmd/compile/internal/arm64

1 file changed

+7
-0
lines changed

src/cmd/compile/internal/arm64/ggen.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ func defframe(ptxt *obj.Prog) {
1919

2020
ptxt.To.Val = int32(gc.Rnd(gc.Curfn.Type.Argwid, int64(gc.Widthptr)))
2121
frame := uint32(gc.Rnd(gc.Stksize+gc.Maxarg, int64(gc.Widthreg)))
22+
23+
// arm64 requires that the frame size (not counting saved LR)
24+
// be empty or be 8 mod 16. If not, pad it.
25+
if frame != 0 && frame%16 != 8 {
26+
frame += 8
27+
}
28+
2229
ptxt.To.Offset = int64(frame)
2330

2431
// insert code to zero ambiguously live variables

0 commit comments

Comments
 (0)