diff --git a/src/cmd/compile/internal/gc/subr.go b/src/cmd/compile/internal/gc/subr.go index f48b7cdc4f..bda1c95137 100644 --- a/src/cmd/compile/internal/gc/subr.go +++ b/src/cmd/compile/internal/gc/subr.go @@ -2862,10 +2862,18 @@ func geneq(sym *Sym, t *Type) { // for a struct containing a reflect.Value, which itself has // an unexported field of type unsafe.Pointer. old_safemode := safemode - safemode = 0 + + // Disable checknils while compiling this code. + // We are comparing a struct or an array, + // neither of which can be nil, and our comparisons + // are shallow. + Disable_checknil++ + funccompile(fn) + safemode = old_safemode + Disable_checknil-- } func ifacelookdot(s *Sym, t *Type, followptr *bool, ignorecase int) *Type {