]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.9] cmd/compile: avoid generating large offsets
authorKeith Randall <khr@golang.org>
Mon, 28 Aug 2017 19:57:52 +0000 (12:57 -0700)
committerRuss Cox <rsc@golang.org>
Wed, 25 Oct 2017 20:23:57 +0000 (20:23 +0000)
commit79996e4a1d33b7404ee076d7455ff8dcc7270250
tree0e62307877640daf6477d9f065b89f10578b6a9f
parentf36b12657c71753029aeefa5e0af3c1607ffe9bb
[release-branch.go1.9] 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>
Reviewed-on: https://go-review.googlesource.com/70981
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
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]