]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: fix unified IR panic when expanding nested inline function
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Fri, 3 Sep 2021 03:49:32 +0000 (10:49 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Thu, 9 Sep 2021 04:37:47 +0000 (04:37 +0000)
commit376a079762bf8db387510d50ed718ec1259d1b7c
treec620005686f2c3abcf5f0443ea0c4d6385f5d564
parent6edc57983a39b3cb911ea88b75a7ad39664383ec
cmd/compile: fix unified IR panic when expanding nested inline function

When reading body of inlining function, which has another inlined
function in the body, the reader still add this inlined function to
todoBodies, which it shouldn't because the inlined function was read
already.

To fix this, introduce new flag to signal that we are done construting
all functions in todoBodies, thus the addBody shouldn't add anything
to todoBodies then.

Updates #48094

Change-Id: I45105dd518f0a7b69c6dcbaf23b957623f271203
Reviewed-on: https://go-review.googlesource.com/c/go/+/347529
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/noder/reader.go
src/cmd/compile/internal/noder/unified.go
test/typeparam/issue48094b.dir/a.go [new file with mode: 0644]
test/typeparam/issue48094b.dir/b.go [new file with mode: 0644]
test/typeparam/issue48094b.go [new file with mode: 0644]