pub struct BodyVisitor<'tcx> {
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>,
}
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>
Implementations§
Source§impl<'tcx> BodyVisitor<'tcx>
impl<'tcx> BodyVisitor<'tcx>
pub fn new( tcx: TyCtxt<'tcx>, def_id: DefId, global_recorder: HashMap<DefId, InterAnalysisRecord<'tcx>>, visit_time: usize, ) -> Self
pub fn get_ty_by_place(&self, p: usize) -> Ty<'tcx>
pub fn update_fields_states(&mut self, inter_result: InterResultNode<'tcx>)
pub fn path_forward_check( &mut self, fn_map: &FxHashMap<DefId, AAResult>, ) -> InterResultNode<'tcx>
pub fn path_analyze_block( &mut self, block: &BasicBlockData<'tcx>, path_index: usize, bb_index: usize, fn_map: &FxHashMap<DefId, AAResult>, )
pub fn path_analyze_statement( &mut self, statement: &Statement<'tcx>, _path_index: usize, )
pub fn path_analyze_terminator( &mut self, terminator: &Terminator<'tcx>, path_index: usize, bb_index: usize, fn_map: &FxHashMap<DefId, AAResult>, )
Sourcefn get_generic_mapping(
&self,
raw_list: &[GenericArg<'tcx>],
def_id: &DefId,
generic_mapping: &mut FxHashMap<String, Ty<'tcx>>,
)
fn get_generic_mapping( &self, raw_list: &[GenericArg<'tcx>], def_id: &DefId, generic_mapping: &mut FxHashMap<String, Ty<'tcx>>, )
Get the generic name to an actual type mapping when used for a def_id. If current def_id doesn’t have generic, then search its parent. The generic set include type and allocator. Example: generic_mapping (T -> u32, A -> std::alloc::Global)
pub fn path_analyze_assign( &mut self, lplace: &Place<'tcx>, rvalue: &Rvalue<'tcx>, path_index: usize, )
pub fn handle_call( &mut self, dst_place: &Place<'tcx>, def_id: &DefId, args: &Box<[Spanned<Operand<'_>>]>, path_index: usize, fn_map: &FxHashMap<DefId, AAResult>, fn_span: Span, generic_mapping: FxHashMap<String, Ty<'tcx>>, )
fn set_bound( &mut self, def_id: &DefId, dst_place: &Place<'tcx>, args: &Box<[Spanned<Operand<'_>>]>, )
pub fn handle_ret_alias( &mut self, dst_place: &Place<'tcx>, def_id: &DefId, fn_map: &FxHashMap<DefId, AAResult>, args: &Box<[Spanned<Operand<'_>>]>, )
pub fn update_post_state( &mut self, post_state: &HashMap<usize, AbstractStateItem<'tcx>>, args: &Box<[Spanned<Operand<'_>>]>, path_index: usize, )
pub fn get_args_post_states( &mut self, ) -> HashMap<usize, AbstractStateItem<'tcx>>
pub fn get_all_paths( &mut self, ) -> HashMap<Vec<usize>, Vec<(Place<'tcx>, Place<'tcx>, BinOp)>>
pub fn abstract_states_mop(&mut self) -> PathInfo<'tcx>
pub fn update_callee_report_level( &mut self, unsafe_callee: String, report_level: usize, )
pub fn output_results(&self, threshold: usize)
pub fn insert_path_abstate( &mut self, path_index: usize, place: usize, abitem: AbstractStateItem<'tcx>, )
pub fn set_constraint( &mut self, constraint: &Vec<(Place<'tcx>, Place<'tcx>, BinOp)>, )
pub fn get_layout_by_place_usize(&self, place: usize) -> PlaceTy<'tcx>
pub fn visit_ty_and_get_layout(&self, ty: Ty<'tcx>) -> PlaceTy<'tcx>
pub fn get_abstate_by_place_in_path( &self, place: usize, path_index: usize, ) -> AbstractStateItem<'tcx>
pub fn handle_cast( &mut self, rpjc_local: usize, lpjc_local: usize, ty: &Ty<'tcx>, path_index: usize, cast_kind: &CastKind, )
pub fn handle_binary_op( &mut self, first_op: &Operand<'_>, bin_op: &BinOp, second_op: &Operand<'_>, path_index: usize, )
pub fn handle_proj(&mut self, is_right: bool, place: Place<'tcx>) -> usize
Source§impl<'tcx> BodyVisitor<'tcx>
impl<'tcx> BodyVisitor<'tcx>
pub fn handle_std_unsafe_call( &mut self, _dst_place: &Place<'_>, def_id: &DefId, args: &[Spanned<Operand<'_>>], _path_index: usize, _fn_map: &FxHashMap<DefId, AAResult>, fn_span: Span, fn_result: UnsafeApi, generic_mapping: FxHashMap<String, Ty<'tcx>>, )
pub fn insert_failed_check_result( &mut self, func_name: String, fn_span: Span, idx: usize, sp: &str, )
pub fn insert_successful_check_result( &mut self, func_name: String, fn_span: Span, idx: usize, sp: &str, )
pub fn insert_checking_result( &mut self, sp: &str, is_passed: bool, func_name: String, fn_span: Span, idx: usize, )
pub fn check_contract( &mut self, arg: usize, args: &[Spanned<Operand<'_>>], contract: PropertyContract<'tcx>, generic_mapping: &FxHashMap<String, Ty<'tcx>>, func_name: String, fn_span: Span, idx: usize, ) -> bool
pub fn check_align(&self, arg: usize, contract_required_ty: Ty<'tcx>) -> bool
pub fn check_non_zst(&self, arg: usize) -> bool
pub fn check_typed(&self, arg: usize) -> bool
pub fn check_non_null(&self, arg: usize) -> bool
pub fn check_init(&self, arg: usize) -> bool
pub fn check_allocator_consistency( &self, _func_name: String, _arg: usize, ) -> bool
pub fn check_allocated(&self, _arg: usize) -> bool
pub fn check_inbound( &self, arg: usize, length_arg: usize, contract_ty: Ty<'tcx>, ) -> bool
Sourcefn check_le_op(
&self,
left_ty: &Ty<'tcx>,
left_arg: usize,
right_ty: &Ty<'tcx>,
right_len: &CisRangeItem,
) -> bool
fn check_le_op( &self, left_ty: &Ty<'tcx>, left_arg: usize, right_ty: &Ty<'tcx>, right_len: &CisRangeItem, ) -> bool
return the result of less equal comparison (left_len * left_ty <= right_len * right_ty)
Sourcefn compare_patial_order_of_two_args(&self, left: usize, right: usize) -> bool
fn compare_patial_order_of_two_args(&self, left: usize, right: usize) -> bool
compare two args, return true if left <= right
pub fn check_valid_string(&self, _arg: usize) -> bool
pub fn check_valid_cstr(&self, _arg: usize) -> bool
pub fn check_valid_num(&self, _arg: usize) -> bool
pub fn check_alias(&self, _arg: usize) -> bool
pub fn check_valid_ptr(&self, arg: usize) -> bool
pub fn check_deref(&self, arg: usize) -> bool
pub fn check_ref_to_ptr(&self, arg: usize) -> bool
pub fn show_error_info(&self, arg: usize)
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more