aarch64/inst/unwind.rs: handle zero-length prologues correctly.

This commit is contained in:
Julian Seward
2020-11-12 17:01:30 +01:00
committed by julian-seward1
parent 19640367db
commit cbce34af0a

View File

@@ -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,