expressions.cc
462 KB
-
compiler: fix crashes on cyclic var/type references · f0ebf6e3
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. Fixes golang/go#25299 Fixes golang/go#25679 Fixes golang/go#25315 Fixes golang/go#25680 Reviewed-on: https://go-review.googlesource.com/115796 From-SVN: r261168
Ian Lance Taylor committed