Commit ddfdd3b8 authored by alph's avatar alph Committed by Commit bot

[runtime stats] Fix crash when RCS are enabled dynamically.

Review-Url: https://codereview.chromium.org/2484963002
Cr-Commit-Position: refs/heads/master@{#40847}
parent ba5885cc
......@@ -309,9 +309,10 @@ void RuntimeCallStats::Leave(RuntimeCallStats* stats, RuntimeCallTimer* timer) {
// static
void RuntimeCallStats::CorrectCurrentCounterId(RuntimeCallStats* stats,
CounterId counter_id) {
DCHECK_NOT_NULL(stats->current_timer_.Value());
RuntimeCallCounter* counter = &(stats->*counter_id);
stats->current_timer_.Value()->counter_ = counter;
RuntimeCallTimer* timer = stats->current_timer_.Value();
// When RCS are enabled dynamically there might be no current timer set up.
if (timer == nullptr) return;
timer->counter_ = &(stats->*counter_id);
}
void RuntimeCallStats::Print(std::ostream& os) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment