Skip to content

Commit 56eb998

Browse files
mateusz834gopherbot
authored andcommitted
[release-branch.go1.24] internal/runtime/maps: pass proper func PC to race.WritePC/race.ReadPC
Fixes #73192 For #73191 Change-Id: I0f8a5a19faa745943a98476c7caf4c97ccdce184 Reviewed-on: https://go-review.googlesource.com/c/go/+/663175 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Michael Pratt <[email protected]> Auto-Submit: Michael Pratt <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> (cherry picked from commit 14b15a2) Reviewed-on: https://go-review.googlesource.com/c/go/+/663777 Reviewed-by: Carlos Amedee <[email protected]> Auto-Submit: Junyang Shao <[email protected]> Reviewed-by: Junyang Shao <[email protected]>
1 parent 43130af commit 56eb998

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/internal/runtime/maps/runtime_fast32_swiss.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
func runtime_mapaccess1_fast32(typ *abi.SwissMapType, m *Map, key uint32) unsafe.Pointer {
1818
if race.Enabled && m != nil {
1919
callerpc := sys.GetCallerPC()
20-
pc := abi.FuncPCABIInternal(runtime_mapaccess1)
20+
pc := abi.FuncPCABIInternal(runtime_mapaccess1_fast32)
2121
race.ReadPC(unsafe.Pointer(m), callerpc, pc)
2222
}
2323

@@ -86,7 +86,7 @@ func runtime_mapaccess1_fast32(typ *abi.SwissMapType, m *Map, key uint32) unsafe
8686
func runtime_mapaccess2_fast32(typ *abi.SwissMapType, m *Map, key uint32) (unsafe.Pointer, bool) {
8787
if race.Enabled && m != nil {
8888
callerpc := sys.GetCallerPC()
89-
pc := abi.FuncPCABIInternal(runtime_mapaccess1)
89+
pc := abi.FuncPCABIInternal(runtime_mapaccess2_fast32)
9090
race.ReadPC(unsafe.Pointer(m), callerpc, pc)
9191
}
9292

@@ -198,7 +198,7 @@ func runtime_mapassign_fast32(typ *abi.SwissMapType, m *Map, key uint32) unsafe.
198198
}
199199
if race.Enabled {
200200
callerpc := sys.GetCallerPC()
201-
pc := abi.FuncPCABIInternal(runtime_mapassign)
201+
pc := abi.FuncPCABIInternal(runtime_mapassign_fast32)
202202
race.WritePC(unsafe.Pointer(m), callerpc, pc)
203203
}
204204
if m.writing != 0 {
@@ -332,7 +332,7 @@ func runtime_mapassign_fast32ptr(typ *abi.SwissMapType, m *Map, key unsafe.Point
332332
}
333333
if race.Enabled {
334334
callerpc := sys.GetCallerPC()
335-
pc := abi.FuncPCABIInternal(runtime_mapassign)
335+
pc := abi.FuncPCABIInternal(runtime_mapassign_fast32ptr)
336336
race.WritePC(unsafe.Pointer(m), callerpc, pc)
337337
}
338338
if m.writing != 0 {
@@ -458,7 +458,7 @@ outer:
458458
func runtime_mapdelete_fast32(typ *abi.SwissMapType, m *Map, key uint32) {
459459
if race.Enabled {
460460
callerpc := sys.GetCallerPC()
461-
pc := abi.FuncPCABIInternal(runtime_mapassign)
461+
pc := abi.FuncPCABIInternal(runtime_mapdelete_fast32)
462462
race.WritePC(unsafe.Pointer(m), callerpc, pc)
463463
}
464464

src/internal/runtime/maps/runtime_fast64_swiss.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
func runtime_mapaccess1_fast64(typ *abi.SwissMapType, m *Map, key uint64) unsafe.Pointer {
1818
if race.Enabled && m != nil {
1919
callerpc := sys.GetCallerPC()
20-
pc := abi.FuncPCABIInternal(runtime_mapaccess1)
20+
pc := abi.FuncPCABIInternal(runtime_mapaccess1_fast64)
2121
race.ReadPC(unsafe.Pointer(m), callerpc, pc)
2222
}
2323

@@ -86,7 +86,7 @@ func runtime_mapaccess1_fast64(typ *abi.SwissMapType, m *Map, key uint64) unsafe
8686
func runtime_mapaccess2_fast64(typ *abi.SwissMapType, m *Map, key uint64) (unsafe.Pointer, bool) {
8787
if race.Enabled && m != nil {
8888
callerpc := sys.GetCallerPC()
89-
pc := abi.FuncPCABIInternal(runtime_mapaccess1)
89+
pc := abi.FuncPCABIInternal(runtime_mapaccess2_fast64)
9090
race.ReadPC(unsafe.Pointer(m), callerpc, pc)
9191
}
9292

@@ -198,7 +198,7 @@ func runtime_mapassign_fast64(typ *abi.SwissMapType, m *Map, key uint64) unsafe.
198198
}
199199
if race.Enabled {
200200
callerpc := sys.GetCallerPC()
201-
pc := abi.FuncPCABIInternal(runtime_mapassign)
201+
pc := abi.FuncPCABIInternal(runtime_mapassign_fast64)
202202
race.WritePC(unsafe.Pointer(m), callerpc, pc)
203203
}
204204
if m.writing != 0 {
@@ -370,7 +370,7 @@ func runtime_mapassign_fast64ptr(typ *abi.SwissMapType, m *Map, key unsafe.Point
370370
}
371371
if race.Enabled {
372372
callerpc := sys.GetCallerPC()
373-
pc := abi.FuncPCABIInternal(runtime_mapassign)
373+
pc := abi.FuncPCABIInternal(runtime_mapassign_fast64ptr)
374374
race.WritePC(unsafe.Pointer(m), callerpc, pc)
375375
}
376376
if m.writing != 0 {
@@ -497,7 +497,7 @@ outer:
497497
func runtime_mapdelete_fast64(typ *abi.SwissMapType, m *Map, key uint64) {
498498
if race.Enabled {
499499
callerpc := sys.GetCallerPC()
500-
pc := abi.FuncPCABIInternal(runtime_mapassign)
500+
pc := abi.FuncPCABIInternal(runtime_mapdelete_fast64)
501501
race.WritePC(unsafe.Pointer(m), callerpc, pc)
502502
}
503503

src/internal/runtime/maps/runtime_faststr_swiss.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func stringPtr(s string) unsafe.Pointer {
103103
func runtime_mapaccess1_faststr(typ *abi.SwissMapType, m *Map, key string) unsafe.Pointer {
104104
if race.Enabled && m != nil {
105105
callerpc := sys.GetCallerPC()
106-
pc := abi.FuncPCABIInternal(runtime_mapaccess1)
106+
pc := abi.FuncPCABIInternal(runtime_mapaccess1_faststr)
107107
race.ReadPC(unsafe.Pointer(m), callerpc, pc)
108108
}
109109

@@ -162,7 +162,7 @@ func runtime_mapaccess1_faststr(typ *abi.SwissMapType, m *Map, key string) unsaf
162162
func runtime_mapaccess2_faststr(typ *abi.SwissMapType, m *Map, key string) (unsafe.Pointer, bool) {
163163
if race.Enabled && m != nil {
164164
callerpc := sys.GetCallerPC()
165-
pc := abi.FuncPCABIInternal(runtime_mapaccess1)
165+
pc := abi.FuncPCABIInternal(runtime_mapaccess2_faststr)
166166
race.ReadPC(unsafe.Pointer(m), callerpc, pc)
167167
}
168168

@@ -266,7 +266,7 @@ func runtime_mapassign_faststr(typ *abi.SwissMapType, m *Map, key string) unsafe
266266
}
267267
if race.Enabled {
268268
callerpc := sys.GetCallerPC()
269-
pc := abi.FuncPCABIInternal(runtime_mapassign)
269+
pc := abi.FuncPCABIInternal(runtime_mapassign_faststr)
270270
race.WritePC(unsafe.Pointer(m), callerpc, pc)
271271
}
272272
if m.writing != 0 {
@@ -396,7 +396,7 @@ outer:
396396
func runtime_mapdelete_faststr(typ *abi.SwissMapType, m *Map, key string) {
397397
if race.Enabled {
398398
callerpc := sys.GetCallerPC()
399-
pc := abi.FuncPCABIInternal(runtime_mapassign)
399+
pc := abi.FuncPCABIInternal(runtime_mapdelete_faststr)
400400
race.WritePC(unsafe.Pointer(m), callerpc, pc)
401401
}
402402

0 commit comments

Comments
 (0)