@@ -1156,25 +1156,14 @@ pub mod parse {
11561156 }
11571157
11581158 pub ( crate ) fn parse_sanitizers ( slot : & mut SanitizerSet , v : Option < & str > ) -> bool {
1159- if let Some ( v) = v {
1160- for s in v. split ( ',' ) {
1161- * slot |= match s {
1162- "address" => SanitizerSet :: ADDRESS ,
1163- "cfi" => SanitizerSet :: CFI ,
1164- "dataflow" => SanitizerSet :: DATAFLOW ,
1165- "kcfi" => SanitizerSet :: KCFI ,
1166- "kernel-address" => SanitizerSet :: KERNELADDRESS ,
1167- "leak" => SanitizerSet :: LEAK ,
1168- "memory" => SanitizerSet :: MEMORY ,
1169- "memtag" => SanitizerSet :: MEMTAG ,
1170- "shadow-call-stack" => SanitizerSet :: SHADOWCALLSTACK ,
1171- "thread" => SanitizerSet :: THREAD ,
1172- "hwaddress" => SanitizerSet :: HWADDRESS ,
1173- "safestack" => SanitizerSet :: SAFESTACK ,
1174- _ => return false ,
1175- }
1159+ if let Some ( s) = v {
1160+ let sanitizer_set = SanitizerSet :: from_comma_list ( s) ;
1161+ if sanitizer_set. is_ok ( ) {
1162+ * slot |= sanitizer_set. unwrap ( ) ;
1163+ true
1164+ } else {
1165+ false
11761166 }
1177- true
11781167 } else {
11791168 false
11801169 }
@@ -2043,6 +2032,8 @@ options! {
20432032 "output remarks for these optimization passes (space separated, or \" all\" )" ) ,
20442033 rpath: bool = ( false , parse_bool, [ UNTRACKED ] ,
20452034 "set rpath values in libs/exes (default: no)" ) ,
2035+ sanitize: SanitizerSet = ( SanitizerSet :: empty( ) , parse_sanitizers, [ TRACKED ] ,
2036+ "use one or multiple sanitizers" ) ,
20462037 save_temps: bool = ( false , parse_bool, [ UNTRACKED ] ,
20472038 "save all temporary output files during compilation (default: no)" ) ,
20482039 soft_float: bool = ( false , parse_bool, [ TRACKED ] ,
@@ -2440,8 +2431,6 @@ options! {
24402431 remark_dir: Option <PathBuf > = ( None , parse_opt_pathbuf, [ UNTRACKED ] ,
24412432 "directory into which to write optimization remarks (if not specified, they will be \
24422433 written to standard error output)") ,
2443- sanitizer: SanitizerSet = ( SanitizerSet :: empty( ) , parse_sanitizers, [ TRACKED ] ,
2444- "use a sanitizer" ) ,
24452434 sanitizer_cfi_canonical_jump_tables: Option <bool > = ( Some ( true ) , parse_opt_bool, [ TRACKED ] ,
24462435 "enable canonical jump tables (default: yes)" ) ,
24472436 sanitizer_cfi_generalize_pointers: Option <bool > = ( None , parse_opt_bool, [ TRACKED ] ,
0 commit comments