mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Currently `UnifiedStatsReporter::flushTracesAndProfiles` can kick off requests when computing the source ranges for collected entities, which will try to record additional stats about the requests. This currently happens to work without issue, but #29289 bumped the counters down slightly such that the vector storing the stats now performs a re-allocation when we do a reentrant stat entry. This then caused a use-after-free as we try to continue iterating over the old buffer. Fix this issue by refusing to record any new stats while we're flushing out the ones we've already recorded.