rapx::analysis::safedrop::graph

Struct SafeDropGraph

source
pub struct SafeDropGraph<'tcx> {
Show 17 fields pub def_id: DefId, pub tcx: TyCtxt<'tcx>, pub span: Span, pub values: Vec<ValueNode>, pub blocks: Vec<BlockNode<'tcx>>, pub arg_size: usize, pub scc_indices: Vec<usize>, pub constant: FxHashMap<usize, usize>, pub return_set: FxHashSet<(usize, usize)>, pub bug_records: BugRecords, pub visit_times: usize, pub alias_set: Vec<usize>, pub dead_record: Vec<bool>, pub adt_owner: AdtOwner, pub child_scc: FxHashMap<usize, (BlockNode<'tcx>, SwitchTargets, FxHashSet<usize>)>, pub disc_map: FxHashMap<usize, usize>, pub terms: Vec<TerminatorKind<'tcx>>,
}

Fields§

§def_id: DefId§tcx: TyCtxt<'tcx>§span: Span§values: Vec<ValueNode>§blocks: Vec<BlockNode<'tcx>>§arg_size: usize§scc_indices: Vec<usize>§constant: FxHashMap<usize, usize>§return_set: FxHashSet<(usize, usize)>§bug_records: BugRecords§visit_times: usize§alias_set: Vec<usize>§dead_record: Vec<bool>§adt_owner: AdtOwner§child_scc: FxHashMap<usize, (BlockNode<'tcx>, SwitchTargets, FxHashSet<usize>)>§disc_map: FxHashMap<usize, usize>§terms: Vec<TerminatorKind<'tcx>>

Implementations§

source§

impl<'tcx> SafeDropGraph<'tcx>

source

pub fn alias_bb(&mut self, bb_index: usize, tcx: TyCtxt<'tcx>)

source

pub fn alias_bbcall( &mut self, bb_index: usize, tcx: TyCtxt<'tcx>, fn_map: &FnMap, )

source

pub fn fill_birth(&mut self, node: usize, birth: isize)

source

pub fn projection( &mut self, tcx: TyCtxt<'tcx>, is_right: bool, place: Place<'tcx>, ) -> usize

source

pub fn merge_alias(&mut self, lv: usize, rv: usize)

source

pub fn merge(&mut self, ret_alias: &RetAlias, arg_vec: &Vec<usize>)

source

pub fn union_find(&mut self, e: usize) -> usize

source

pub fn union_merge(&mut self, e1: usize, e2: usize)

source

pub fn union_is_same(&mut self, e1: usize, e2: usize) -> bool

source

pub fn union_has_alias(&mut self, e: usize) -> bool

source§

impl<'tcx> SafeDropGraph<'tcx>

source

pub fn report_bugs(&self)

source

pub fn uaf_check( &mut self, aliaset_idx: usize, span: Span, local: usize, is_func_call: bool, )

source

pub fn exist_dead( &mut self, node: usize, record: &mut FxHashSet<usize>, dangling: bool, ) -> bool

source

pub fn is_dangling(&mut self, local: usize) -> bool

source

pub fn df_check(&mut self, drop: usize, span: Span) -> bool

source

pub fn dp_check(&mut self, current_block: &BlockNode<'tcx>)

source

pub fn dead_node( &mut self, drop: usize, birth: usize, info: &SourceInfo, alias: bool, )

source

pub fn get_field_seq(&self, value: &ValueNode) -> Vec<usize>

source§

impl<'tcx> SafeDropGraph<'tcx>

source

pub fn corner_handle( &mut self, _left_ssa: usize, _merge_vec: &Vec<usize>, def_id: DefId, ) -> bool

source

pub fn should_check(def_id: DefId) -> bool

source§

impl<'tcx> SafeDropGraph<'tcx>

source

pub fn new( body: &Body<'tcx>, tcx: TyCtxt<'tcx>, def_id: DefId, adt_owner: AdtOwner, ) -> SafeDropGraph<'tcx>

source

pub fn tarjan( &mut self, index: usize, stack: &mut Vec<usize>, instack: &mut FxHashSet<usize>, dfn: &mut Vec<usize>, low: &mut Vec<usize>, time: &mut usize, )

source

pub fn solve_scc(&mut self)

source

pub fn dfs_on_spanning_tree( &self, index: usize, stack: &mut Vec<usize>, paths: &mut Vec<Vec<usize>>, )

source

pub fn get_paths(&self) -> Vec<Vec<usize>>

source

pub fn switch_target( &mut self, tcx: TyCtxt<'tcx>, block_index: usize, ) -> Option<usize>

source§

impl<'tcx> SafeDropGraph<'tcx>

source

pub fn drop_check(&mut self, bb_index: usize, tcx: TyCtxt<'tcx>)

source

pub fn drop_heap_item_check( &self, place: &Place<'tcx>, tcx: TyCtxt<'tcx>, ) -> bool

source

pub fn split_check( &mut self, bb_index: usize, tcx: TyCtxt<'tcx>, fn_map: &FnMap, )

source

pub fn split_check_with_cond( &mut self, bb_index: usize, path_discr_id: usize, path_discr_val: usize, tcx: TyCtxt<'tcx>, fn_map: &FnMap, )

source

pub fn check(&mut self, bb_index: usize, tcx: TyCtxt<'tcx>, fn_map: &FnMap)

source

pub fn calculate_scc_order( &mut self, scc: &Vec<usize>, path: &mut Vec<usize>, ans: &mut Vec<Vec<usize>>, disc_map: &mut HashMap<usize, usize>, idx: usize, root: usize, visit: &mut HashSet<usize>, )

Auto Trait Implementations§

§

impl<'tcx> Freeze for SafeDropGraph<'tcx>

§

impl<'tcx> !RefUnwindSafe for SafeDropGraph<'tcx>

§

impl<'tcx> !Send for SafeDropGraph<'tcx>

§

impl<'tcx> !Sync for SafeDropGraph<'tcx>

§

impl<'tcx> Unpin for SafeDropGraph<'tcx>

§

impl<'tcx> !UnwindSafe for SafeDropGraph<'tcx>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.