From dbb4322e511b6be756c8fd0a1ee1697b5b110de9 Mon Sep 17 00:00:00 2001 From: James Y Knight Date: Tue, 4 Jun 2019 15:27:19 +0000 Subject: [PATCH] [lldb] Fix out-of-bounds read after c3ea7c66fec021867e005ad1b02f3c7e80feaa85 "Add support for mid-function epilogues on x86 that end in a non-local jump." Detected by asan. llvm-svn: 362510 --- lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp b/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp index e4d5ff0..af54115 100644 --- a/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp +++ b/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp @@ -736,7 +736,6 @@ bool x86AssemblyInspectionEngine::pc_rel_branch_or_jump_p ( int opcode_size = 0; uint8_t b1 = m_cur_insn[0]; - uint8_t b2 = m_cur_insn[1]; switch (b1) { case 0x77: // JA/JNBE rel8 @@ -764,6 +763,7 @@ bool x86AssemblyInspectionEngine::pc_rel_branch_or_jump_p ( break; } if (b1 == 0x0f && opcode_size == 0) { + uint8_t b2 = m_cur_insn[1]; switch (b2) { case 0x87: // JA/JNBE rel16/rel32 case 0x86: // JBE/JNA rel16/rel32 -- 2.7.4