@@ -808,25 +808,14 @@ pub mod parse {
808808 }
809809
810810 pub ( crate ) fn parse_sanitizers ( slot : & mut SanitizerSet , v : Option < & str > ) -> bool {
811- if let Some ( v) = v {
812- for s in v. split ( ',' ) {
813- * slot |= match s {
814- "address" => SanitizerSet :: ADDRESS ,
815- "cfi" => SanitizerSet :: CFI ,
816- "dataflow" => SanitizerSet :: DATAFLOW ,
817- "kcfi" => SanitizerSet :: KCFI ,
818- "kernel-address" => SanitizerSet :: KERNELADDRESS ,
819- "leak" => SanitizerSet :: LEAK ,
820- "memory" => SanitizerSet :: MEMORY ,
821- "memtag" => SanitizerSet :: MEMTAG ,
822- "shadow-call-stack" => SanitizerSet :: SHADOWCALLSTACK ,
823- "thread" => SanitizerSet :: THREAD ,
824- "hwaddress" => SanitizerSet :: HWADDRESS ,
825- "safestack" => SanitizerSet :: SAFESTACK ,
826- _ => return false ,
827- }
811+ if let Some ( s) = v {
812+ let sanitizer_set = SanitizerSet :: from_comma_list ( s) ;
813+ if sanitizer_set. is_ok ( ) {
814+ * slot |= sanitizer_set. unwrap ( ) ;
815+ true
816+ } else {
817+ false
828818 }
829- true
830819 } else {
831820 false
832821 }
@@ -1647,6 +1636,8 @@ options! {
16471636 "output remarks for these optimization passes (space separated, or \" all\" )" ) ,
16481637 rpath: bool = ( false , parse_bool, [ UNTRACKED ] ,
16491638 "set rpath values in libs/exes (default: no)" ) ,
1639+ sanitize: SanitizerSet = ( SanitizerSet :: empty( ) , parse_sanitizers, [ TRACKED ] ,
1640+ "use one or multiple sanitizers" ) ,
16501641 save_temps: bool = ( false , parse_bool, [ UNTRACKED ] ,
16511642 "save all temporary output files during compilation (default: no)" ) ,
16521643 soft_float: bool = ( false , parse_bool, [ TRACKED ] ,
@@ -2017,8 +2008,6 @@ options! {
20172008 remark_dir: Option <PathBuf > = ( None , parse_opt_pathbuf, [ UNTRACKED ] ,
20182009 "directory into which to write optimization remarks (if not specified, they will be \
20192010 written to standard error output)") ,
2020- sanitizer: SanitizerSet = ( SanitizerSet :: empty( ) , parse_sanitizers, [ TRACKED ] ,
2021- "use a sanitizer" ) ,
20222011 sanitizer_cfi_canonical_jump_tables: Option <bool > = ( Some ( true ) , parse_opt_bool, [ TRACKED ] ,
20232012 "enable canonical jump tables (default: yes)" ) ,
20242013 sanitizer_cfi_generalize_pointers: Option <bool > = ( None , parse_opt_bool, [ TRACKED ] ,
0 commit comments