aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/json/encode.go
diff options
context:
space:
mode:
authorDavid Chase <drchase@google.com>2016-05-06 17:05:02 -0700
committerDavid Chase <drchase@google.com>2016-05-09 18:35:44 +0000
commit3c090019172afd4517360606efc50750d3e278fa (patch)
tree38383087293c0dc1bb186204410a13a76c22a136 /src/encoding/json/encode.go
parent149ac34893ad1cc5023ae2fbabd0d553f21b0313 (diff)
downloadgo-3c090019172afd4517360606efc50750d3e278fa.tar.xz
cmd/compile: correct sparseSet probes in regalloc to avoid index error
In regalloc, a sparse map is preallocated for later use by spill-in-loop sinking. However, variables (spills) are added during register allocation before spill sinking, and a map query involving any of these new variables will index out of bounds in the map. To fix: 1) fix the queries to use s.orig[v.ID].ID instead, to ensure proper indexing. Note that s.orig will be nil for values that are not eligible for spilling (like memory and flags). 2) add a test. Fixes #15585. Change-Id: I8f2caa93b132a0f2a9161d2178320d5550583075 Reviewed-on: https://go-review.googlesource.com/22911 Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/encoding/json/encode.go')
0 files changed, 0 insertions, 0 deletions