Skip to content

Commit

Permalink
Merge #1681
Browse files Browse the repository at this point in the history
1681: Fix warning about zero-sized FDEs. r=nlewycky a=nlewycky

# Description
The LLVM implementation of libunwind API will emit a warning when `__register_frame` is called with a zero-size FDE. There's usually only one at the end of a CIE, but just skip any that come up.

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Nick Lewycky <[email protected]>
Co-authored-by: nlewycky <[email protected]>
  • Loading branch information
bors[bot] and nlewycky authored Oct 5, 2020
2 parents 1b90a8f + 852a898 commit 63ec921
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/engine-jit/src/unwind/systemv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,9 @@ impl UnwindRegistry {
while current < end {
let len = std::ptr::read::<u32>(current as *const u32) as usize;

// Skip over the CIE
if current != start {
// If len == 0, __register_frame will be a no-op.
// So rather than skip it here, we just let __register_frame
// deal with empty FDEs the way they want.
// Skip over the CIE and zero-length FDEs.
// LLVM's libunwind emits a warning on zero-length FDEs.
if current != start && len != 0 {
__register_frame(current);
self.registrations.push(current as usize);
}
Expand Down

0 comments on commit 63ec921

Please sign in to comment.