From c18035d6ba94bf3b1afdec3a904af7a871f9eaca Mon Sep 17 00:00:00 2001 From: Carlos Caballero Date: Mon, 9 Sep 2024 13:04:21 +0000 Subject: [PATCH] Fix use after move Change-Id: I5ef191f7e553d226e0b2014b8f146a2e97505a2f --- src/trace_processor/importers/perf/perf_data_tokenizer.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/trace_processor/importers/perf/perf_data_tokenizer.cc b/src/trace_processor/importers/perf/perf_data_tokenizer.cc index d804721caf..9dc75324f1 100644 --- a/src/trace_processor/importers/perf/perf_data_tokenizer.cc +++ b/src/trace_processor/importers/perf/perf_data_tokenizer.cc @@ -260,8 +260,8 @@ PerfDataTokenizer::ParseRecords() { !res.ok() || *res != ParsingResult::kSuccess) { return res; } - - switch (record.header.type) { + const uint32_t type = record.header.type; + switch (type) { case PERF_RECORD_AUXTRACE: PERFETTO_CHECK(!current_auxtrace_.has_value()); current_auxtrace_.emplace(); @@ -279,8 +279,8 @@ PerfDataTokenizer::ParseRecords() { default: if (!PushRecord(std::move(record)).ok()) { - context_->storage->IncrementIndexedStats( - stats::perf_record_skipped, static_cast(record.header.type)); + context_->storage->IncrementIndexedStats(stats::perf_record_skipped, + static_cast(type)); } break; }