Merge pull request #2462 from cfallin/fix-sorted-debug-addr-transform
Debug info: two fixes in x64 backend.
This commit is contained in:
@@ -674,6 +674,12 @@ impl<I: VCodeInst> MachBuffer<I> {
|
|||||||
// (end of buffer)
|
// (end of buffer)
|
||||||
self.data.truncate(b.start as usize);
|
self.data.truncate(b.start as usize);
|
||||||
self.fixup_records.truncate(b.fixup);
|
self.fixup_records.truncate(b.fixup);
|
||||||
|
while let Some(last_srcloc) = self.srclocs.last() {
|
||||||
|
if last_srcloc.end <= b.start {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
self.srclocs.pop();
|
||||||
|
}
|
||||||
// State:
|
// State:
|
||||||
// [PRE CODE]
|
// [PRE CODE]
|
||||||
// cur_off, Offset b.start, b.labels_at_this_branch:
|
// cur_off, Offset b.start, b.labels_at_this_branch:
|
||||||
@@ -1184,12 +1190,15 @@ impl<I: VCodeInst> MachBuffer<I> {
|
|||||||
// incorrect.
|
// incorrect.
|
||||||
assert!(self.fixup_records.is_empty());
|
assert!(self.fixup_records.is_empty());
|
||||||
|
|
||||||
|
let mut srclocs = self.srclocs;
|
||||||
|
srclocs.sort_by_key(|entry| entry.start);
|
||||||
|
|
||||||
MachBufferFinalized {
|
MachBufferFinalized {
|
||||||
data: self.data,
|
data: self.data,
|
||||||
relocs: self.relocs,
|
relocs: self.relocs,
|
||||||
traps: self.traps,
|
traps: self.traps,
|
||||||
call_sites: self.call_sites,
|
call_sites: self.call_sites,
|
||||||
srclocs: self.srclocs,
|
srclocs,
|
||||||
stack_maps: self.stack_maps,
|
stack_maps: self.stack_maps,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user