From b41185c5c3da2d5f52b3b5aa7eb034addd458938 Mon Sep 17 00:00:00 2001 From: Dan Scales Date: Thu, 13 Jan 2022 13:20:19 -0800 Subject: cmd/compile: add call to ImportedBody() when exporting shape inst body When we export a shape instantiation, because a particular fully-instantiated type is needed by an inlineable function, we possibly export the body of the instantiation, if it is inlineable. In this case, we should have been calling ImportedBody() to make sure that the function body had already been read in (if it is actually imported from another package). Fixes #50598 Change-Id: I512d2bcc745faa6ff3a97e25bc8f46e2c2643d23 Reviewed-on: https://go-review.googlesource.com/c/go/+/378494 Trust: Dan Scales Run-TryBot: Dan Scales TryBot-Result: Gopher Robot Reviewed-by: Cuong Manh Le Reviewed-by: Keith Randall --- src/cmd/compile/internal/typecheck/crawler.go | 1 + 1 file changed, 1 insertion(+) (limited to 'src/cmd/compile/internal/typecheck/crawler.go') diff --git a/src/cmd/compile/internal/typecheck/crawler.go b/src/cmd/compile/internal/typecheck/crawler.go index 11c8056df5..a25c741488 100644 --- a/src/cmd/compile/internal/typecheck/crawler.go +++ b/src/cmd/compile/internal/typecheck/crawler.go @@ -252,6 +252,7 @@ func (p *crawler) checkForFullyInst(t *types.Type) { if HaveInlineBody(methNode.Func) { // Export the body as well if // instantiation is inlineable. + ImportedBody(methNode.Func) methNode.Func.SetExportInline(true) } } -- cgit v1.2.3-54-g00ecf