• 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
..
README Loading commit data...
arithmetic.go Loading commit data...
bitfield.go Loading commit data...
bits.go Loading commit data...
comparisons.go Loading commit data...
condmove.go Loading commit data...
copy.go Loading commit data...
floats.go Loading commit data...
issue22703.go Loading commit data...
issue25378.go Loading commit data...
mapaccess.go Loading commit data...
maps.go Loading commit data...
math.go Loading commit data...
mathbits.go Loading commit data...
memcombine.go Loading commit data...
memops.go Loading commit data...
noextend.go Loading commit data...
rotate.go Loading commit data...
shift.go Loading commit data...
slices.go Loading commit data...
stack.go Loading commit data...
strings.go Loading commit data...
structs.go Loading commit data...
zerosize.go Loading commit data...