• Matthew Dempsky's avatar
    cmd/compile: refactor onebitwalktype1 · 39983cf4
    Matthew Dempsky authored
    The existing logic tried to advance the offset for each variable's
    width, but then tried to undo this logic with the array and struct
    handling code. It can all be much simpler by only worrying about
    computing offsets within the array and struct code.
    
    While here, include a short-circuit for zero-width arrays to fix a
    pedantic compiler failure case.
    
    Passes toolstash-check.
    
    Fixes #20739.
    
    Change-Id: I98af9bb512a33e3efe82b8bf1803199edb480640
    Reviewed-on: https://go-review.googlesource.com/64471
    Run-TryBot: Matthew Dempsky <mdempsky@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
    39983cf4
issue20739.go 273 Bytes