mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: include callee args section when checking frame too large
The stack frame includes the callee args section. At the point where we were checking the frame size, that part of the frame had not been computed yet. Move the check later so we can include the callee args size. Fixes #20780 Update #25507 Change-Id: Iab97cb89b3a24f8ca19b9123ef2a111d6850c3fe Reviewed-on: https://go-review.googlesource.com/115195 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
parent
161874da2a
commit
06b326054d
4 changed files with 43 additions and 9 deletions
|
|
@ -659,14 +659,6 @@ func Main(archInit func(*Arch)) {
|
|||
Ctxt.DwFixups = nil
|
||||
genDwarfInline = 0
|
||||
}
|
||||
|
||||
// Check whether any of the functions we have compiled have gigantic stack frames.
|
||||
obj.SortSlice(largeStackFrames, func(i, j int) bool {
|
||||
return largeStackFrames[i].Before(largeStackFrames[j])
|
||||
})
|
||||
for _, largePos := range largeStackFrames {
|
||||
yyerrorl(largePos, "stack frame too large (>1GB)")
|
||||
}
|
||||
}
|
||||
|
||||
// Phase 9: Check external declarations.
|
||||
|
|
@ -688,6 +680,14 @@ func Main(archInit func(*Arch)) {
|
|||
dumpasmhdr()
|
||||
}
|
||||
|
||||
// Check whether any of the functions we have compiled have gigantic stack frames.
|
||||
obj.SortSlice(largeStackFrames, func(i, j int) bool {
|
||||
return largeStackFrames[i].Before(largeStackFrames[j])
|
||||
})
|
||||
for _, largePos := range largeStackFrames {
|
||||
yyerrorl(largePos, "stack frame too large (>1GB)")
|
||||
}
|
||||
|
||||
if len(compilequeue) != 0 {
|
||||
Fatalf("%d uncompiled functions", len(compilequeue))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue