Skip to content

Commit

Permalink
aarch64/inst/unwind.rs: handle zero-length prologues correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-seward1 committed Nov 12, 2020
1 parent 1964036 commit cbce34a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cranelift/codegen/src/isa/aarch64/inst/unwind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ impl UnwindInfoGenerator<Inst> for AArch64UnwindInfo {

// TODO epilogues

let prologue_size = context.insts_layout[context.prologue.end as usize - 1];
let prologue_size = if context.prologue.is_empty() {
0
} else {
context.insts_layout[context.prologue.end as usize - 1]
};

Ok(Some(UnwindInfo {
prologue_size,
prologue_unwind_codes: codes,
Expand Down

0 comments on commit cbce34a

Please sign in to comment.