@@ -811,25 +811,14 @@ pub mod parse {
811811 }
812812
813813 pub ( crate ) fn parse_sanitizers ( slot : & mut SanitizerSet , v : Option < & str > ) -> bool {
814- if let Some ( v) = v {
815- for s in v. split ( ',' ) {
816- * slot |= match s {
817- "address" => SanitizerSet :: ADDRESS ,
818- "cfi" => SanitizerSet :: CFI ,
819- "dataflow" => SanitizerSet :: DATAFLOW ,
820- "kcfi" => SanitizerSet :: KCFI ,
821- "kernel-address" => SanitizerSet :: KERNELADDRESS ,
822- "leak" => SanitizerSet :: LEAK ,
823- "memory" => SanitizerSet :: MEMORY ,
824- "memtag" => SanitizerSet :: MEMTAG ,
825- "shadow-call-stack" => SanitizerSet :: SHADOWCALLSTACK ,
826- "thread" => SanitizerSet :: THREAD ,
827- "hwaddress" => SanitizerSet :: HWADDRESS ,
828- "safestack" => SanitizerSet :: SAFESTACK ,
829- _ => return false ,
830- }
814+ if let Some ( s) = v {
815+ let sanitizer_set = SanitizerSet :: from_comma_list ( s) ;
816+ if sanitizer_set. is_ok ( ) {
817+ * slot |= sanitizer_set. unwrap ( ) ;
818+ true
819+ } else {
820+ false
831821 }
832- true
833822 } else {
834823 false
835824 }
@@ -1635,6 +1624,8 @@ options! {
16351624 "output remarks for these optimization passes (space separated, or \" all\" )" ) ,
16361625 rpath: bool = ( false , parse_bool, [ UNTRACKED ] ,
16371626 "set rpath values in libs/exes (default: no)" ) ,
1627+ sanitize: SanitizerSet = ( SanitizerSet :: empty( ) , parse_sanitizers, [ TRACKED ] ,
1628+ "use one or multiple sanitizers" ) ,
16381629 save_temps: bool = ( false , parse_bool, [ UNTRACKED ] ,
16391630 "save all temporary output files during compilation (default: no)" ) ,
16401631 soft_float: bool = ( false , parse_bool, [ TRACKED ] ,
@@ -2003,8 +1994,6 @@ options! {
20031994 remark_dir: Option <PathBuf > = ( None , parse_opt_pathbuf, [ UNTRACKED ] ,
20041995 "directory into which to write optimization remarks (if not specified, they will be \
20051996 written to standard error output)") ,
2006- sanitizer: SanitizerSet = ( SanitizerSet :: empty( ) , parse_sanitizers, [ TRACKED ] ,
2007- "use a sanitizer" ) ,
20081997 sanitizer_cfi_canonical_jump_tables: Option <bool > = ( Some ( true ) , parse_opt_bool, [ TRACKED ] ,
20091998 "enable canonical jump tables (default: yes)" ) ,
20101999 sanitizer_cfi_generalize_pointers: Option <bool > = ( None , parse_opt_bool, [ TRACKED ] ,
0 commit comments