mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Also check ttype_index when using SJLJ
This commit is contained in:
parent
34534152f5
commit
04a697502f
@ -121,13 +121,21 @@ pub unsafe fn find_eh_action(lsda: *const u8, context: &EHContext<'_>) -> Result
|
||||
let mut idx = ip;
|
||||
loop {
|
||||
let cs_lpad = reader.read_uleb128();
|
||||
let cs_action = reader.read_uleb128();
|
||||
let cs_action_entry = reader.read_uleb128();
|
||||
idx -= 1;
|
||||
if idx == 0 {
|
||||
// Can never have null landing pad for sjlj -- that would have
|
||||
// been indicated by a -1 call site index.
|
||||
let lpad = (cs_lpad + 1) as usize;
|
||||
return Ok(interpret_cs_action(cs_action, lpad));
|
||||
if cs_action_entry == 0 {
|
||||
return Ok(interpret_cs_action(0, lpad));
|
||||
} else {
|
||||
let action_record =
|
||||
(action_table as *mut u8).offset(cs_action_entry as isize - 1);
|
||||
let mut action_reader = DwarfReader::new(action_record);
|
||||
let ttype_index = action_reader.read_sleb128();
|
||||
return Ok(interpret_cs_action(ttype_index as u64, lpad));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user