]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: guard against loads with negative offset from readonly constants
authorCherry Zhang <cherryyz@google.com>
Fri, 15 Feb 2019 20:01:29 +0000 (15:01 -0500)
committerCherry Zhang <cherryyz@google.com>
Sat, 16 Feb 2019 02:02:31 +0000 (02:02 +0000)
commitdca707b2a040642bb46aa4da4fb4eb6188cc2502
tree56da343c6509427cb8bd3f8a09d0b6fdfbbdbeb4
parentef454fd586ee30d8b35b5895320619ebde2beb98
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>
src/cmd/compile/internal/ssa/rewrite.go
test/fixedbugs/issue29215.go