Commit 5cd8a344 authored by Dan Scales's avatar Dan Scales
Browse files

cmd/compile: fix gcSizes.Sizeof for a zero-sized struct

(*gcSizes).Sizeof was requiring the last field of a zero-sized struct to
be at least one byte. But that rule (fix for #9401, see logic in
calcStructOffset) only applies to a struct that has some non-zero sized
fields. Fix (*gcSizes).Sizeof to have the logic like calcStructOffset.

Fixes running the gotests with -G=3 enabled.

Fixes #45390

Change-Id: I011f40e3de3a327392bbbb791b9422be75336313
Reviewed-on: https://go-review.googlesource.com/c/go/+/307549


Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
Trust: Dan Scales <danscales@google.com>
parent 84162b88
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment