rapx::analysis::senryx::visitor

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 path_forward_check(&mut self, fn_map: &FnMap)

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_terminator( &mut self, terminator: &Terminator<'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_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 abstate_debug(&self)

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_operand(&self, op: &Operand<'_>) -> usize

source

pub fn get_proj_ty(&self, place: usize) -> Option<Ty<'tcx>>

source

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

source§

impl<'tcx> BodyVisitor<'tcx>

source

pub fn handle_std_unsafe_call( &mut self, _dst_place: &Place<'_>, def_id: &DefId, args: &Box<[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_allocator_consistency(&self, _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_int(&self, _arg: usize) -> bool

source

pub fn check_init(&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.