• Keith Randall's avatar
    cmd/compile: pad zero-sized stack variables · c5414457
    Keith Randall authored
    If someone takes a pointer to a zero-sized stack variable, it can
    be incorrectly interpreted as a pointer to the next object in the
    stack frame. To avoid this, add some padding after zero-sized variables.
    
    We only need to pad if the next variable in memory (which is the
    previous variable in the order in which we allocate variables to the
    stack frame) has pointers. If the next variable has no pointers, it
    won't hurt to have a pointer to it.
    
    Because we allocate all pointer-containing variables before all
    non-pointer-containing variables, we should only have to pad once per
    frame.
    
    Fixes #24993
    
    Change-Id: Ife561cdfdf964fdbf69af03ae6ba97d004e6193c
    Reviewed-on: https://go-review.googlesource.com/c/155698
    Run-TryBot: Keith Randall <khr@golang.org>
    Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    c5414457
Name
Last commit
Last update
..
addr2line Loading commit data...
api Loading commit data...
asm Loading commit data...
buildid Loading commit data...
cgo Loading commit data...
compile Loading commit data...
cover Loading commit data...
dist Loading commit data...
doc Loading commit data...
fix Loading commit data...
go Loading commit data...
gofmt Loading commit data...
internal Loading commit data...
link Loading commit data...
nm Loading commit data...
objdump Loading commit data...
pack Loading commit data...
pprof Loading commit data...
test2json Loading commit data...
trace Loading commit data...
vendor Loading commit data...
vet Loading commit data...