]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.12] cmd/compile: guard against loads with negative offset from...
authorCherry Zhang <cherryyz@google.com>
Fri, 15 Feb 2019 20:01:29 +0000 (15:01 -0500)
committerIan Lance Taylor <iant@golang.org>
Mon, 25 Feb 2019 05:17:28 +0000 (05:17 +0000)
commita718f939d258f184709e95e581657fb8f1a6f8a8
tree1d8d72d8c43947be97781686ee057831e5e9c3ea
parentda1f5d376a74dc75b641ae0beb4b98519d57c59a
[release-branch.go1.12] cmd/compile: guard against loads with negative offset from readonly constants

CL 154057 adds guards agaist out-of-bound reads from readonly
constants. It turns out that in dead code, the offset can also
be negative. Guard against negative offset as well.

Fixes #30257.

Change-Id: I47c2a2e434dd466c08ae6f50f213999a358c796e
Reviewed-on: https://go-review.googlesource.com/c/162819
Reviewed-by: Keith Randall <khr@golang.org>
(cherry picked from commit dca707b2a040642bb46aa4da4fb4eb6188cc2502)
Reviewed-on: https://go-review.googlesource.com/c/162827
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/compile/internal/ssa/rewrite.go
test/fixedbugs/issue29215.go