@@ -746,6 +746,7 @@ impl AsanRuntime {
746
746
}
747
747
748
748
/// Reset all allocations so that they can be reused for new allocation requests.
749
+ #[ allow( clippy:: unused_self) ]
749
750
pub fn reset_allocations ( & self ) {
750
751
Allocator :: get ( ) . reset ( ) ;
751
752
}
@@ -759,11 +760,13 @@ impl AsanRuntime {
759
760
}
760
761
}
761
762
763
+ #[ allow( clippy:: unused_self) ]
762
764
pub fn errors ( & mut self ) -> & Option < AsanErrors > {
763
765
unsafe { & ASAN_ERRORS }
764
766
}
765
767
766
768
/// Make sure the specified memory is unpoisoned
769
+ #[ allow( clippy:: unused_self) ]
767
770
pub fn unpoison ( & self , address : usize , size : usize ) {
768
771
Allocator :: get ( ) . map_shadow_for_region ( address, address + size, true ) ;
769
772
}
@@ -779,6 +782,7 @@ impl AsanRuntime {
779
782
}
780
783
781
784
/// Unpoison all the memory that is currently mapped with read/write permissions.
785
+ #[ allow( clippy:: unused_self) ]
782
786
fn unpoison_all_existing_memory ( & self ) {
783
787
let mut allocator = Allocator :: get ( ) ;
784
788
walk_self_maps ( & mut |start, end, permissions, _path| {
@@ -794,6 +798,7 @@ impl AsanRuntime {
794
798
795
799
/// Register the current thread with the runtime, implementing shadow memory for its stack and
796
800
/// tls mappings.
801
+ #[ allow( clippy:: unused_self) ]
797
802
pub fn register_thread ( & self ) {
798
803
let mut allocator = Allocator :: get ( ) ;
799
804
let ( stack_start, stack_end) = Self :: current_stack ( ) ;
@@ -855,6 +860,7 @@ impl AsanRuntime {
855
860
856
861
/// Locate the target library and hook it's memory allocation functions
857
862
#[ cfg( unix) ]
863
+ #[ allow( clippy:: unused_self) ]
858
864
fn hook_library ( & mut self , path : & str ) {
859
865
let target_lib = GotHookLibrary :: new ( path, false ) ;
860
866
@@ -925,6 +931,8 @@ impl AsanRuntime {
925
931
}
926
932
}
927
933
934
+ #[ allow( clippy:: cast_sign_loss) ] // for displacement
935
+ #[ allow( clippy:: too_many_lines) ]
928
936
extern "C" fn handle_trap ( & mut self ) {
929
937
let mut actual_pc = self . regs [ 31 ] ;
930
938
actual_pc = match self . stalked_addresses . get ( & actual_pc) {
@@ -990,6 +998,7 @@ impl AsanRuntime {
990
998
base_reg -= capstone:: arch:: arm64:: Arm64Reg :: ARM64_REG_S0 as u16 ;
991
999
}
992
1000
1001
+ #[ allow( clippy:: clippy:: cast_possible_wrap) ]
993
1002
let mut fault_address =
994
1003
( self . regs [ base_reg as usize ] as isize + displacement as isize ) as usize ;
995
1004
@@ -1043,6 +1052,7 @@ impl AsanRuntime {
1043
1052
}
1044
1053
} else {
1045
1054
let mut allocator = Allocator :: get ( ) ;
1055
+ #[ allow( clippy:: option_if_let_else) ]
1046
1056
if let Some ( metadata) =
1047
1057
allocator. find_metadata ( fault_address, self . regs [ base_reg as usize ] )
1048
1058
{
@@ -1076,6 +1086,7 @@ impl AsanRuntime {
1076
1086
self . report_error ( error) ;
1077
1087
}
1078
1088
1089
+ #[ allow( clippy:: too_many_lines) ]
1079
1090
fn report_error ( & mut self , error : AsanError ) {
1080
1091
unsafe {
1081
1092
ASAN_ERRORS . as_mut ( ) . unwrap ( ) . errors . push ( error. clone ( ) ) ;
@@ -1356,6 +1367,7 @@ impl AsanRuntime {
1356
1367
}
1357
1368
}
1358
1369
1370
+ #[ allow( clippy:: unused_self) ]
1359
1371
fn generate_shadow_check_blob ( & mut self , bit : u32 ) -> Box < [ u8 ] > {
1360
1372
let shadow_bit = Allocator :: get ( ) . shadow_bit as u32 ;
1361
1373
macro_rules! shadow_check {
@@ -1386,6 +1398,7 @@ impl AsanRuntime {
1386
1398
ops_vec[ ..ops_vec. len ( ) - 4 ] . to_vec ( ) . into_boxed_slice ( )
1387
1399
}
1388
1400
1401
+ #[ allow( clippy:: unused_self) ]
1389
1402
fn generate_shadow_check_exact_blob ( & mut self , val : u32 ) -> Box < [ u8 ] > {
1390
1403
let shadow_bit = Allocator :: get ( ) . shadow_bit as u32 ;
1391
1404
macro_rules! shadow_check_exact {
@@ -1422,6 +1435,8 @@ impl AsanRuntime {
1422
1435
///
1423
1436
/// Generate the instrumentation blobs for the current arch.
1424
1437
#[ allow( clippy:: similar_names) ] // We allow things like dword and qword
1438
+ #[ allow( clippy:: cast_possible_wrap) ]
1439
+ #[ allow( clippy:: too_many_lines) ]
1425
1440
fn generate_instrumentation_blobs ( & mut self ) {
1426
1441
let mut ops_report = dynasmrt:: VecAssembler :: < dynasmrt:: aarch64:: Aarch64Relocation > :: new ( 0 ) ;
1427
1442
dynasm ! ( ops_report
@@ -1522,7 +1537,7 @@ impl AsanRuntime {
1522
1537
//offset r30 (x30) at cfa-8
1523
1538
//offset r29 (x29) at cfa-16
1524
1539
; . dword 0x1d0c4c00
1525
- ; . dword 0x9d029e10 as u32 as i32
1540
+ ; . dword 0x9d029e10u32 as i32
1526
1541
; . dword 0x04
1527
1542
// empty next FDE:
1528
1543
; . dword 0x0
0 commit comments