Skip to content

Commit be3df87

Browse files
committed
Fix CI
1 parent aa61fb0 commit be3df87

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ GOROOT=/path/to/go-panikint /path/to/go-panikint/bin/go test -v .
121121
CI notes:
122122
- Pull requests run workflow linting (actionlint + zizmor), `go vet`, and type checking (`go test -run=^$`) in `tests/` using the built toolchain.
123123
- Pushes to `master` run the build + tests (both truncation disabled/enabled).
124+
- The compiler may generate many identical panic message strings; string symbol emission is serialized to avoid rare `go:string."..." redeclared` build failures.
124125
125126
Note: the upstream Go distribution tests in `$GOROOT/test` intentionally rely on integer wrap-around.
126127
The go-panikint unit tests live in `$GOROOT/tests` (plural) and should run with overflow checks enabled.

src/cmd/compile/internal/staticdata/data.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ const (
6464
stringSymPattern = ".gostring.%d.%s"
6565
)
6666

67+
var stringSymMu sync.Mutex
68+
6769
// shortHashString converts the hash to a string for use with stringSymPattern.
6870
// We cut it to 16 bytes and then base64-encode to make it even smaller.
6971
func shortHashString(hash []byte) string {
@@ -88,11 +90,13 @@ func StringSym(pos src.XPos, s string) (data *obj.LSym) {
8890
}
8991

9092
symdata := base.Ctxt.Lookup(stringSymPrefix + symname)
93+
stringSymMu.Lock()
9194
if !symdata.OnList() {
9295
off := dstringdata(symdata, 0, s, pos, "string")
9396
objw.Global(symdata, int32(off), obj.DUPOK|obj.RODATA|obj.LOCAL)
9497
symdata.Set(obj.AttrContentAddressable, true)
9598
}
99+
stringSymMu.Unlock()
96100

97101
return symdata
98102
}

tests/unit_test.test

4.21 MB
Binary file not shown.

0 commit comments

Comments
 (0)