Fix an instance of -Wunused-but-set-variable.

Bug: chromium:794619
Change-Id: I4db52a6d895535b79e75331c51017489f490b4c1
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3206094
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
This commit is contained in:
Peter Kasting 2021-10-05 10:31:59 -07:00 committed by Crashpad LUCI CQ
parent 718d5d52ea
commit e29981e10c

View File

@ -747,7 +747,9 @@ void InProcessIntermediateDumpHandler::WriteThreadInfo(
writer, IntermediateDumpKey::kThreads); writer, IntermediateDumpKey::kThreads);
// Exception thread ID. // Exception thread ID.
#if defined(ARCH_CPU_ARM64)
uint64_t exception_thread_id = 0; uint64_t exception_thread_id = 0;
#endif
thread_identifier_info identifier_info; thread_identifier_info identifier_info;
mach_msg_type_number_t count = THREAD_IDENTIFIER_INFO_COUNT; mach_msg_type_number_t count = THREAD_IDENTIFIER_INFO_COUNT;
kern_return_t kr = kern_return_t kr =
@ -756,7 +758,9 @@ void InProcessIntermediateDumpHandler::WriteThreadInfo(
reinterpret_cast<thread_info_t>(&identifier_info), reinterpret_cast<thread_info_t>(&identifier_info),
&count); &count);
if (kr == KERN_SUCCESS) { if (kr == KERN_SUCCESS) {
#if defined(ARCH_CPU_ARM64)
exception_thread_id = identifier_info.thread_id; exception_thread_id = identifier_info.thread_id;
#endif
} else { } else {
CRASHPAD_RAW_LOG_ERROR(kr, "thread_info::THREAD_IDENTIFIER_INFO"); CRASHPAD_RAW_LOG_ERROR(kr, "thread_info::THREAD_IDENTIFIER_INFO");
} }
@ -803,7 +807,9 @@ void InProcessIntermediateDumpHandler::WriteThreadInfo(
} }
// Thread ID. // Thread ID.
#if defined(ARCH_CPU_ARM64)
uint64_t thread_id; uint64_t thread_id;
#endif
thread_identifier_info identifier_info; thread_identifier_info identifier_info;
count = THREAD_IDENTIFIER_INFO_COUNT; count = THREAD_IDENTIFIER_INFO_COUNT;
kr = thread_info(thread, kr = thread_info(thread,
@ -811,7 +817,9 @@ void InProcessIntermediateDumpHandler::WriteThreadInfo(
reinterpret_cast<thread_info_t>(&identifier_info), reinterpret_cast<thread_info_t>(&identifier_info),
&count); &count);
if (kr == KERN_SUCCESS) { if (kr == KERN_SUCCESS) {
#if defined(ARCH_CPU_ARM64)
thread_id = identifier_info.thread_id; thread_id = identifier_info.thread_id;
#endif
WriteProperty( WriteProperty(
writer, IntermediateDumpKey::kThreadID, &identifier_info.thread_id); writer, IntermediateDumpKey::kThreadID, &identifier_info.thread_id);
WriteProperty(writer, WriteProperty(writer,