Struct BodyVisitor

Source
pub struct BodyVisitor<'tcx> {
Show 13 fields pub tcx: TyCtxt<'tcx>, pub def_id: DefId, pub safedrop_graph: SafeDropGraph<'tcx>, pub abstract_states: HashMap<usize, PathInfo<'tcx>>, pub unsafe_callee_report: HashMap<String, usize>, pub local_ty: HashMap<usize, PlaceTy<'tcx>>, pub visit_time: usize, pub check_results: Vec<CheckResult>, pub generic_map: HashMap<String, HashSet<Ty<'tcx>>>, pub global_recorder: HashMap<DefId, InterAnalysisRecord<'tcx>>, pub proj_ty: HashMap<usize, Ty<'tcx>>, pub chains: DominatedGraph<'tcx>, pub paths: Vec<Vec<usize>>,
}

Fields§

§tcx: TyCtxt<'tcx>§def_id: DefId§safedrop_graph: SafeDropGraph<'tcx>§abstract_states: HashMap<usize, PathInfo<'tcx>>§unsafe_callee_report: HashMap<String, usize>§local_ty: HashMap<usize, PlaceTy<'tcx>>§visit_time: usize§check_results: Vec<CheckResult>§generic_map: HashMap<String, HashSet<Ty<'tcx>>>§global_recorder: HashMap<DefId, InterAnalysisRecord<'tcx>>§proj_ty: HashMap<usize, Ty<'tcx>>§chains: DominatedGraph<'tcx>§paths: Vec<Vec<usize>>

Implementations§

Source§

impl<'tcx> BodyVisitor<'tcx>

Source

pub fn new( tcx: TyCtxt<'tcx>, def_id: DefId, global_recorder: HashMap<DefId, InterAnalysisRecord<'tcx>>, visit_time: usize, ) -> Self

Source

pub fn get_ty_by_place(&self, p: usize) -> Ty<'tcx>

Source

pub fn update_fields_states(&mut self, inter_result: InterResultNode<'tcx>)

Source

pub fn path_forward_check(&mut self, fn_map: &FnMap) -> InterResultNode<'tcx>

Source

pub fn path_analyze_block( &mut self, block: &BasicBlockData<'tcx>, path_index: usize, bb_index: usize, fn_map: &FnMap, )

Source

pub fn path_analyze_statement( &mut self, statement: &Statement<'tcx>, _path_index: usize, )

Source

pub fn path_analyze_terminator( &mut self, terminator: &Terminator<'tcx>, path_index: usize, bb_index: usize, fn_map: &FnMap, )

Source

pub fn path_analyze_assign( &mut self, lplace: &Place<'tcx>, rvalue: &Rvalue<'tcx>, path_index: usize, )

Source

pub fn handle_call( &mut self, dst_place: &Place<'tcx>, def_id: &DefId, args: &Box<[Spanned<Operand<'_>>]>, path_index: usize, fn_map: &FnMap, fn_span: Span, )

Source

pub fn handle_ret_alias( &mut self, dst_place: &Place<'tcx>, def_id: &DefId, fn_map: &FnMap, args: &Box<[Spanned<Operand<'_>>]>, )

Source

pub fn update_post_state( &mut self, post_state: &HashMap<usize, AbstractStateItem<'tcx>>, args: &Box<[Spanned<Operand<'_>>]>, path_index: usize, )

Source

pub fn get_args_post_states( &mut self, ) -> HashMap<usize, AbstractStateItem<'tcx>>

Source

pub fn get_all_paths(&mut self) -> Vec<Vec<usize>>

Source

pub fn abstract_states_mop(&mut self) -> PathInfo<'tcx>

Source

pub fn update_callee_report_level( &mut self, unsafe_callee: String, report_level: usize, )

Source

pub fn output_results(&self, threshold: usize)

Source

pub fn insert_path_abstate( &mut self, path_index: usize, place: usize, abitem: AbstractStateItem<'tcx>, )

Source

pub fn get_layout_by_place_usize(&self, place: usize) -> PlaceTy<'tcx>

Source

pub fn visit_ty_and_get_layout(&self, ty: Ty<'tcx>) -> PlaceTy<'tcx>

Source

pub fn get_abstate_by_place_in_path( &self, place: usize, path_index: usize, ) -> AbstractStateItem<'tcx>

Source

pub fn handle_cast( &mut self, rpjc_local: usize, lpjc_local: usize, ty: &Ty<'tcx>, path_index: usize, cast_kind: &CastKind, )

Source

pub fn handle_binary_op( &mut self, first_op: &Operand<'_>, bin_op: &BinOp, second_op: &Operand<'_>, path_index: usize, )

Source

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

Source§

impl BodyVisitor<'_>

Source

pub fn handle_std_unsafe_call( &mut self, _dst_place: &Place<'_>, def_id: &DefId, args: &[Spanned<Operand<'_>>], _path_index: usize, _fn_map: &FnMap, fn_span: Span, fn_result: UnsafeApi, )

Source

pub fn insert_failed_check_result( &mut self, func_name: String, fn_span: Span, idx: usize, sp: &str, )

Source

pub fn insert_successful_check_result( &mut self, func_name: String, fn_span: Span, idx: usize, sp: &str, )

Source

pub fn check_align(&self, arg: usize) -> bool

Source

pub fn check_non_zst(&self, arg: usize) -> bool

Source

pub fn check_typed(&self, arg: usize) -> bool

Source

pub fn check_non_null(&self, arg: usize) -> bool

Source

pub fn check_init(&self, arg: usize) -> bool

Source

pub fn check_allocator_consistency( &self, _func_name: String, _arg: usize, ) -> bool

Source

pub fn check_allocated(&self, _arg: usize) -> bool

Source

pub fn check_inbounded(&self, _arg: usize) -> bool

Source

pub fn check_valid_string(&self, _arg: usize) -> bool

Source

pub fn check_valid_cstr(&self, _arg: usize) -> bool

Source

pub fn check_valid_num(&self, _arg: usize) -> bool

Source

pub fn check_alias(&self, _arg: usize) -> bool

Source

pub fn check_valid_ptr(&self, arg: usize) -> bool

Source

pub fn check_deref(&self, arg: usize) -> bool

Source

pub fn check_ref_to_ptr(&self, arg: usize) -> bool

Auto Trait Implementations§

§

impl<'tcx> Freeze for BodyVisitor<'tcx>

§

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

§

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

§

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

§

impl<'tcx> Unpin for BodyVisitor<'tcx>

§

impl<'tcx> !UnwindSafe for BodyVisitor<'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.