diff options
Diffstat (limited to 'src/runtime/mstats.go')
| -rw-r--r-- | src/runtime/mstats.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/runtime/mstats.go b/src/runtime/mstats.go index c75ca747d0..f67d05414d 100644 --- a/src/runtime/mstats.go +++ b/src/runtime/mstats.go @@ -662,6 +662,9 @@ func purgecachedstats(c *mcache) { // overflow errors. //go:nosplit func mSysStatInc(sysStat *uint64, n uintptr) { + if sysStat == nil { + return + } if sys.BigEndian { atomic.Xadd64(sysStat, int64(n)) return @@ -676,6 +679,9 @@ func mSysStatInc(sysStat *uint64, n uintptr) { // mSysStatInc apply. //go:nosplit func mSysStatDec(sysStat *uint64, n uintptr) { + if sysStat == nil { + return + } if sys.BigEndian { atomic.Xadd64(sysStat, -int64(n)) return |
