From 7a622b2f6baaacdff5c8f3acf7efe32b378b4ee7 Mon Sep 17 00:00:00 2001 From: Stephan Hartmann Date: Fri, 8 Jul 2022 19:24:46 +0200 Subject: [PATCH] GCC: fix invalid bind of packed field to uint32_t& GCC does not allow binding a packed field to an address. Assign to a intermediate variable instead before pushing to map. Bug: chromium:819294 Change-Id: I806e5f99c2b19e656b91a60f72172b59c961ba5f Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3751392 Reviewed-by: Mark Mentovai Commit-Queue: Mark Mentovai --- snapshot/minidump/process_snapshot_minidump.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/snapshot/minidump/process_snapshot_minidump.cc b/snapshot/minidump/process_snapshot_minidump.cc index 28942447..b9e7ea29 100644 --- a/snapshot/minidump/process_snapshot_minidump.cc +++ b/snapshot/minidump/process_snapshot_minidump.cc @@ -643,7 +643,9 @@ bool ProcessSnapshotMinidump::InitializeThreadNames() { return false; } - thread_names_.emplace(minidump_thread_name.ThreadId, std::move(name)); + // See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36566 + const uint32_t thread_id = minidump_thread_name.ThreadId; + thread_names_.emplace(thread_id, std::move(name)); } return true;