Fix issue with garbage address in .debug_line.

Summary:
While emitting debug lines for a function we don't overwrite, we
don't have a code section context that is needed by default
writing routine. Hence we have to emit end_sequence after the
last address, not at the end of section.

(cherry picked from FBD3291533)
This commit is contained in:
Maksim Panchenko 2016-05-11 19:13:38 -07:00
parent f7e7e25b88
commit b445f5eb7b
1 changed files with 2 additions and 1 deletions

View File

@ -2296,7 +2296,8 @@ void RewriteInstance::updateDebugLineInfoForNonSimpleFunctions() {
ELF::SHT_PROGBITS,
ELF::SHF_EXECINSTR | ELF::SHF_ALLOC);
if (LineTable->lookupAddressRange(Address, Function.getSize(), Results)) {
if (LineTable->lookupAddressRange(Address, Function.getMaxSize() + 1,
Results)) {
for (auto RowIndex : Results) {
const auto &Row = LineTable->Rows[RowIndex];
BC->Ctx->setCurrentDwarfLoc(