]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: avoid generating large offsets
authorKeith Randall <khr@golang.org>
Mon, 28 Aug 2017 19:57:52 +0000 (12:57 -0700)
committerKeith Randall <khr@golang.org>
Mon, 28 Aug 2017 22:02:59 +0000 (22:02 +0000)
commit053840dc00d9ccca93f8e44dd622c08235fece5e
tree58d74f34d08c82312da74fe6aa41591b784ebf2c
parent0b4f4e0153bbdb231eff3f3928f99eae3e48b363
cmd/compile: avoid generating large offsets

The assembler barfs on large offsets. Make sure that all the
instructions that need to have their offsets in an int32
  1) check on any rule that computes offsets for such instructions
  2) change their aux fields so the check builder checks it.

The assembler also silently misassembled offsets between 1<<31
and 1<<32. Add a check in the assembler to barf on those as well.

Fixes #21655

Change-Id: Iebf24bf10f9f37b3ea819ceb7d588251c0f46d7d
Reviewed-on: https://go-review.googlesource.com/59630
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/gen/AMD64Ops.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewriteAMD64.go
src/cmd/internal/obj/x86/asm6.go
test/fixedbugs/issue21655.go [new file with mode: 0644]