]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: abort earlier if stack frame too large
authorKeith Randall <khr@golang.org>
Wed, 11 Oct 2017 00:43:41 +0000 (17:43 -0700)
committerKeith Randall <khr@golang.org>
Wed, 11 Oct 2017 18:24:13 +0000 (18:24 +0000)
commite130dcf051862276c42df2f120457803d2e70138
treeaa8910b37da3fd045754ab73a50881f505035919
parent624630b8247ca8150e10417f0da3e2fb2ce19eac
cmd/compile: abort earlier if stack frame too large

If the stack frame is too large, abort immediately.
We used to generate code first, then abort.
In issue 22200, generating code raised a panic
so we got an ICE instead of an error message.

Change the max frame size to 1GB (from 2GB).
Stack frames between 1.1GB and 2GB didn't used to work anyway,
the pcln table generation would have failed and generated an ICE.

Fixes #22200

Change-Id: I1d918ab27ba6ebf5c87ec65d1bccf973f8c8541e
Reviewed-on: https://go-review.googlesource.com/69810
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
12 files changed:
src/cmd/compile/internal/gc/main.go
src/cmd/compile/internal/gc/pgen.go
src/cmd/compile/internal/gc/ssa.go
src/cmd/internal/obj/arm/asm5.go
src/cmd/internal/obj/arm64/asm7.go
src/cmd/internal/obj/link.go
src/cmd/internal/obj/mips/asm0.go
src/cmd/internal/obj/pcln.go
src/cmd/internal/obj/x86/asm6.go
src/go/types/stdlib_test.go
test/fixedbugs/issue22200.go [new file with mode: 0644]
test/fixedbugs/issue22200b.go [new file with mode: 0644]