aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorDan Scales <danscales@google.com>2021-12-01 10:53:17 -0800
committerDan Scales <danscales@google.com>2021-12-02 07:04:05 +0000
commitd34051bf16d86a88e6c5764aa076219069702045 (patch)
treea80556f2aca78d003a804a084423e578e8c26671 /src/runtime
parent1b2930d70c8bad5ecae08275e56e228e0f424b02 (diff)
downloadgo-d34051bf16d86a88e6c5764aa076219069702045.tar.xz
cmd/compile: fix case where g.curDecl should be saved/restored
When we set g.curDecl for the type params created during fillinMethods for an instantiated type, we need to save/restore its value, because fillinMethods() may be called while processing a typeDecl. We want the value of g.curDecl to continue to be correct for type params created in the typeDecl. Because of ordering issues, not restoring g.curDecl happens to cause problems (which don't always show up visibly) exactly when a type param is not actually used in a type declaration. Cleared g.curDecl to "" at the later points in typeDecl() and funcDecl(). This allows adding asserts that g.curDecl is always empty ("") when we set it in typeDecl() and funcDecl(), and always non-empty when we use it in typ0(). Fixes #49893 Change-Id: Ic2fb1df791585bd257f2b86ffaae0453c31705c5 Reviewed-on: https://go-review.googlesource.com/c/go/+/368454 Trust: Dan Scales <danscales@google.com> Run-TryBot: Dan Scales <danscales@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src/runtime')
0 files changed, 0 insertions, 0 deletions