Skip to content

Commit b8ebcb5

Browse files
committed
x86AssemblyInspectionEngine::AugmentUnwindPlanFromCallSite could access
the byte past the end of the buffer it had been given. ASAN catch. <rdar://problem/30774863> llvm-svn: 296733
1 parent bda3c7d commit b8ebcb5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -979,11 +979,12 @@ bool x86AssemblyInspectionEngine::AugmentUnwindPlanFromCallSite(
979979
offset += insn_len;
980980
m_cur_insn = data + offset;
981981

982-
if (reinstate_unwind_state) {
983-
// that was the last instruction of this function
984-
if (offset >= size)
985-
continue;
982+
// offset is pointing beyond the bounds of the
983+
// function; stop looping.
984+
if (offset >= size)
985+
continue;
986986

987+
if (reinstate_unwind_state) {
987988
UnwindPlan::RowSP new_row(new UnwindPlan::Row());
988989
*new_row = *original_last_row;
989990
new_row->SetOffset(offset);

0 commit comments

Comments
 (0)