@@ -813,25 +813,14 @@ pub mod parse {
813813 }
814814
815815 pub ( crate ) fn parse_sanitizers ( slot : & mut SanitizerSet , v : Option < & str > ) -> bool {
816- if let Some ( v) = v {
817- for s in v. split ( ',' ) {
818- * slot |= match s {
819- "address" => SanitizerSet :: ADDRESS ,
820- "cfi" => SanitizerSet :: CFI ,
821- "dataflow" => SanitizerSet :: DATAFLOW ,
822- "kcfi" => SanitizerSet :: KCFI ,
823- "kernel-address" => SanitizerSet :: KERNELADDRESS ,
824- "leak" => SanitizerSet :: LEAK ,
825- "memory" => SanitizerSet :: MEMORY ,
826- "memtag" => SanitizerSet :: MEMTAG ,
827- "shadow-call-stack" => SanitizerSet :: SHADOWCALLSTACK ,
828- "thread" => SanitizerSet :: THREAD ,
829- "hwaddress" => SanitizerSet :: HWADDRESS ,
830- "safestack" => SanitizerSet :: SAFESTACK ,
831- _ => return false ,
832- }
816+ if let Some ( s) = v {
817+ let sanitizer_set = SanitizerSet :: from_comma_list ( s) ;
818+ if sanitizer_set. is_ok ( ) {
819+ * slot |= sanitizer_set. unwrap ( ) ;
820+ true
821+ } else {
822+ false
833823 }
834- true
835824 } else {
836825 false
837826 }
@@ -1648,6 +1637,8 @@ options! {
16481637 "output remarks for these optimization passes (space separated, or \" all\" )" ) ,
16491638 rpath: bool = ( false , parse_bool, [ UNTRACKED ] ,
16501639 "set rpath values in libs/exes (default: no)" ) ,
1640+ sanitize: SanitizerSet = ( SanitizerSet :: empty( ) , parse_sanitizers, [ TRACKED ] ,
1641+ "use one or multiple sanitizers" ) ,
16511642 save_temps: bool = ( false , parse_bool, [ UNTRACKED ] ,
16521643 "save all temporary output files during compilation (default: no)" ) ,
16531644 soft_float: bool = ( false , parse_bool, [ TRACKED ] ,
@@ -2018,8 +2009,6 @@ options! {
20182009 remark_dir: Option <PathBuf > = ( None , parse_opt_pathbuf, [ UNTRACKED ] ,
20192010 "directory into which to write optimization remarks (if not specified, they will be \
20202011 written to standard error output)") ,
2021- sanitizer: SanitizerSet = ( SanitizerSet :: empty( ) , parse_sanitizers, [ TRACKED ] ,
2022- "use a sanitizer" ) ,
20232012 sanitizer_cfi_canonical_jump_tables: Option <bool > = ( Some ( true ) , parse_opt_bool, [ TRACKED ] ,
20242013 "enable canonical jump tables (default: yes)" ) ,
20252014 sanitizer_cfi_generalize_pointers: Option <bool > = ( None , parse_opt_bool, [ TRACKED ] ,
0 commit comments