From f2eb759901f1fb7c96654b2461ae8fc348e250bb Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 23 Jun 2021 21:50:06 +0200 Subject: [PATCH] Profiler: Use u32 when constructing InstructionData When constructing values of the InstructionData type we assume that the event_count field is a size_t while it actually is a u32. On x86_64 this fails because those are different types. --- Userland/DevTools/Profiler/DisassemblyModel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/DevTools/Profiler/DisassemblyModel.cpp b/Userland/DevTools/Profiler/DisassemblyModel.cpp index 59e78189907..b12720062f3 100644 --- a/Userland/DevTools/Profiler/DisassemblyModel.cpp +++ b/Userland/DevTools/Profiler/DisassemblyModel.cpp @@ -85,7 +85,7 @@ DisassemblyModel::DisassemblyModel(Profile& profile, ProfileNode& node) auto disassembly = insn.value().to_string(address_in_profiled_program, &symbol_provider); StringView instruction_bytes = view.substring_view(offset_into_symbol, insn.value().length()); - size_t samples_at_this_instruction = m_node.events_per_address().get(address_in_profiled_program).value_or(0); + u32 samples_at_this_instruction = m_node.events_per_address().get(address_in_profiled_program).value_or(0); float percent = ((float)samples_at_this_instruction / (float)m_node.event_count()) * 100.0f; m_instructions.append({ insn.value(), disassembly, instruction_bytes, address_in_profiled_program, samples_at_this_instruction, percent });