]> Cypherpunks repositories - gostls13.git/commit
[dev.regabi] cmd/compile: reorg generated array hash loop
authorKeith Randall <khr@golang.org>
Sun, 6 Dec 2020 01:25:28 +0000 (17:25 -0800)
committerKeith Randall <khr@golang.org>
Mon, 14 Dec 2020 21:39:00 +0000 (21:39 +0000)
commit617383377f0e870a9258230cf29fd11097b9229a
tree8219896a3d69f2365ef2132b5a24e0f253c5c5b9
parent89f38323faa57d3f7475016f778be69fcffbe9fb
[dev.regabi] cmd/compile: reorg generated array hash loop

The ORANGE structure that is being replaced by this CL was causing
trouble with another CL (CL 275695).

The problem occurs if you typecheck i in the middle of generating the
body of the ORANGE loop. If you typecheck i, it ends up typechecking
its definition, which secretly typechecks the containing ORANGE.  If
you then add other items to the ORANGE body, those items will never
get typechecked, as the ORANGE is already marked as typechecked.

Instead, just steal the loop we use for the equality code. Might as
well use the same pattern in both places.

Change-Id: Idb1ac77881d2cc9da08c7437a652b50d3ee45e2e
Reviewed-on: https://go-review.googlesource.com/c/go/+/275713
Trust: Keith Randall <khr@golang.org>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
src/cmd/compile/internal/gc/alg.go