cmd/compile/internal/gc: reject invalid unsafe.Sizeof([0]byte{}[0])
Apply static bounds checking logic during type checking even to zero-element arrays, but skip synthesized OINDEX nodes that the compiler has asserted are within bounds (such as the ones generated while desugaring ORANGE nodes). This matches the logic in walkexpr that also skips static bounds checking when Bounded is true. Passes toolstash/buildall. Fixes #12944. Change-Id: I14ba03d71c002bf969d69783bec8d1a8e10e7d75 Reviewed-on: https://go-review.googlesource.com/15902Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Showing
test/fixedbugs/issue12944.go
0 → 100644
Please
register
or
sign in
to comment