summaryrefslogtreecommitdiffstats
path: root/lldb/source/Symbol/Function.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2012-04-25 19:48:30 +0000
committerJim Ingham <jingham@apple.com>2012-04-25 19:48:30 +0000
commite5b2245d685a38979d3260e0358c19c9216dc521 (patch)
tree0e05c2d9157781a518efb65cdd302786600acb7d /lldb/source/Symbol/Function.cpp
parent365f1ec246889a93d6ac7cc7e217eeee6e2ad571 (diff)
downloadbcm5719-llvm-e5b2245d685a38979d3260e0358c19c9216dc521.tar.gz
bcm5719-llvm-e5b2245d685a38979d3260e0358c19c9216dc521.zip
Make sure the end of the first line is still within the function, and if not, don't push the prologue past it.
rdar://problem/11271074 llvm-svn: 155579
Diffstat (limited to 'lldb/source/Symbol/Function.cpp')
-rw-r--r--lldb/source/Symbol/Function.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lldb/source/Symbol/Function.cpp b/lldb/source/Symbol/Function.cpp
index 1fddd18afc8..e1afb92bdbc 100644
--- a/lldb/source/Symbol/Function.cpp
+++ b/lldb/source/Symbol/Function.cpp
@@ -564,7 +564,12 @@ Function::GetPrologueByteSize ()
// of the function.
const addr_t func_start_file_addr = m_range.GetBaseAddress().GetFileAddress();
const addr_t line_entry_end_file_addr = line_entry.range.GetBaseAddress().GetFileAddress() + line_entry.range.GetByteSize();
- if (line_entry_end_file_addr > func_start_file_addr)
+ // Watch out for the case where the end of the first line is at or past the end of the function, in that
+ // case, set the prologue byte size to 0. This happens, for instance, with a function that is one
+ // instruction long...
+ if (!GetAddressRange().ContainsFileAddress(line_entry_end_file_addr))
+ m_prologue_byte_size = 0;
+ else if (line_entry_end_file_addr > func_start_file_addr)
m_prologue_byte_size = line_entry_end_file_addr - func_start_file_addr;
}
}
OpenPOWER on IntegriCloud