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) { ...@@ -309,9 +309,10 @@ void RuntimeCallStats::Leave(RuntimeCallStats* stats, RuntimeCallTimer* timer) {
// static // static
void RuntimeCallStats::CorrectCurrentCounterId(RuntimeCallStats* stats, void RuntimeCallStats::CorrectCurrentCounterId(RuntimeCallStats* stats,
CounterId counter_id) { CounterId counter_id) {
DCHECK_NOT_NULL(stats->current_timer_.Value()); RuntimeCallTimer* timer = stats->current_timer_.Value();
RuntimeCallCounter* counter = &(stats->*counter_id); // When RCS are enabled dynamically there might be no current timer set up.
stats->current_timer_.Value()->counter_ = counter; if (timer == nullptr) return;
timer->counter_ = &(stats->*counter_id);
} }
void RuntimeCallStats::Print(std::ostream& os) { 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