]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/importer: exportdata section ends with the last index of "\n...
authorTim King <taking@google.com>
Fri, 8 Nov 2024 22:00:49 +0000 (14:00 -0800)
committerTim King <taking@google.com>
Wed, 13 Nov 2024 00:03:12 +0000 (00:03 +0000)
commit0ff1d425075ce830a1f1c5ef3bf54ae812312bc3
tree893f84a13c044c8c81ae370643dfff93733297c4
parent1f8fa4941f632575468498bfac48fc1cbbf1a54f
cmd/compile/internal/importer: exportdata section ends with the last index of "\n$$\n"

This fixes a bug in the test only function Import where it looked for
the first instance of the string "\n$$\n" as the end of the exportdata
section. This should look for the last instance of "\n$$\n" within
the ar file.

Adds unit tests that demonstrate the error.

Added comments to tests that can correctly use the first instance.

Change-Id: I7a85afa41cf1c2902119516b757b7c6625d46d13
Reviewed-on: https://go-review.googlesource.com/c/go/+/626775
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
src/cmd/compile/internal/importer/gcimporter.go
src/cmd/compile/internal/importer/gcimporter_test.go
src/cmd/compile/internal/importer/testdata/exports.go
src/go/internal/gcimporter/gcimporter_test.go
src/go/internal/gcimporter/testdata/exports.go