From 434905b97d961531286d4b49c7ee1969f7cbea0e Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Mon, 16 Dec 2019 17:38:13 -0800 Subject: Run all threads when extending a next range over a call. If you don't do this you end up running arbitrary code with only one thread allowed to run, which can cause deadlocks. Differential Revision: https://reviews.llvm.org/D71440 --- lldb/source/Core/Disassembler.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lldb/source/Core/Disassembler.cpp') diff --git a/lldb/source/Core/Disassembler.cpp b/lldb/source/Core/Disassembler.cpp index 89ae25cbad6..33172cc8868 100644 --- a/lldb/source/Core/Disassembler.cpp +++ b/lldb/source/Core/Disassembler.cpp @@ -1101,15 +1101,22 @@ void InstructionList::Append(lldb::InstructionSP &inst_sp) { uint32_t InstructionList::GetIndexOfNextBranchInstruction(uint32_t start, Target &target, - bool ignore_calls) const { + bool ignore_calls, + bool *found_calls) const { size_t num_instructions = m_instructions.size(); uint32_t next_branch = UINT32_MAX; size_t i; + + if (found_calls) + *found_calls = false; for (i = start; i < num_instructions; i++) { if (m_instructions[i]->DoesBranch()) { - if (ignore_calls && m_instructions[i]->IsCall()) + if (ignore_calls && m_instructions[i]->IsCall()) { + if (found_calls) + *found_calls = true; continue; + } next_branch = i; break; } -- cgit v1.2.3