Author: jmolenda Date: Wed Mar 1 23:08:10 2017 New Revision: 296733 URL: http://llvm.org/viewvc/llvm-project?rev=296733&view=rev Log: x86AssemblyInspectionEngine::AugmentUnwindPlanFromCallSite could access the byte past the end of the buffer it had been given. ASAN catch. <rdar://problem/30774863>
Modified: lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp Modified: lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp?rev=296733&r1=296732&r2=296733&view=diff ============================================================================== --- lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp (original) +++ lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp Wed Mar 1 23:08:10 2017 @@ -979,11 +979,12 @@ bool x86AssemblyInspectionEngine::Augmen offset += insn_len; m_cur_insn = data + offset; - if (reinstate_unwind_state) { - // that was the last instruction of this function - if (offset >= size) - continue; + // offset is pointing beyond the bounds of the + // function; stop looping. + if (offset >= size) + continue; + if (reinstate_unwind_state) { UnwindPlan::RowSP new_row(new UnwindPlan::Row()); *new_row = *original_last_row; new_row->SetOffset(offset); _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits