Verify that all predecessors to an EBB are valid branches, and have the EBB recorded as a successor.
This commit is contained in:
committed by
Jakob Stoklund Olesen
parent
c596ea1ac1
commit
bb0246c8c1
@@ -72,6 +72,11 @@ impl JumpTableData {
|
||||
.enumerate())
|
||||
}
|
||||
|
||||
/// Checks if any of the entries branch to `ebb`.
|
||||
pub fn branches_to(&self, ebb: Ebb) -> bool {
|
||||
self.table.iter().any(|target_ebb| target_ebb.expand() == Some(ebb))
|
||||
}
|
||||
|
||||
/// Access the whole table as a mutable slice.
|
||||
pub fn as_mut_slice(&mut self) -> &mut [PackedOption<Ebb>] {
|
||||
self.table.as_mut_slice()
|
||||
|
||||
Reference in New Issue
Block a user