• David Chase's avatar
    cmd/compile: correct sparseSet probes in regalloc to avoid index error · 3c090019
    David Chase authored
    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/22911Reviewed-by: 's avatarKeith Randall <khr@golang.org>
    Run-TryBot: David Chase <drchase@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    3c090019
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...