summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Disassembler.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2019-12-16 17:38:13 -0800
committerJim Ingham <jingham@apple.com>2019-12-16 17:45:21 -0800
commit434905b97d961531286d4b49c7ee1969f7cbea0e (patch)
treee56180fd34ddd0d7316f26a5fffd9b4d2005a9c5 /lldb/source/Core/Disassembler.cpp
parent53bcd1e1413c878d2d988df80142a430a9abf24a (diff)
downloadbcm5719-llvm-434905b97d961531286d4b49c7ee1969f7cbea0e.tar.gz
bcm5719-llvm-434905b97d961531286d4b49c7ee1969f7cbea0e.zip
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. <rdar://problem/56422478> Differential Revision: https://reviews.llvm.org/D71440
Diffstat (limited to 'lldb/source/Core/Disassembler.cpp')
-rw-r--r--lldb/source/Core/Disassembler.cpp11
1 files changed, 9 insertions, 2 deletions
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;
}
OpenPOWER on IntegriCloud