You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
compiler: fix crashes on cyclic var/type references
This patch fixes type traversal to avoid compiler crashes for test
cases where a type T includes an expression that refers back to the
type without actually explicitly mentioning T. Examples include
var x [uintptr(unsafe.Sizeof(&x))]byte
var a [len(a)]int
The fix involves expanding the set of types that the traversal code
"remembers" (to avoid cycles) to include array types, and introducing an
additional guard in Builtin_call_expression::do_is_constant to catch
cyclic type constructs.
Fixesgolang/go#25299Fixesgolang/go#25679Fixesgolang/go#25315Fixesgolang/go#25680
Change-Id: I9e9bfe4413e3ddd7ce611d5164dea36c165dd4c6
Reviewed-on: https://go-review.googlesource.com/115796
Reviewed-by: Ian Lance Taylor <iant@golang.org>
0 commit comments