File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -532,8 +532,19 @@ static void mi_option_init(mi_option_desc_t* desc) {
532532 desc -> init = INITIALIZED ;
533533 }
534534 else {
535- _mi_warning_message ("environment option mimalloc_%s has an invalid value: %s\n" , desc -> name , buf );
535+ /* _mi_warning_message() will itself call mi_option_get() for some options,
536+ * so to avoid a possible infinite recursion it's important to mark the option as
537+ * "initialized" first */
536538 desc -> init = DEFAULTED ;
539+ if (desc -> option == mi_option_verbose ) {
540+ /* Special case: if the 'mimalloc_verbose' env var has a bogus value we'd never know
541+ * (since the value default to 'off') - so in that one case briefly set the option to 'on' */
542+ desc -> value = 1 ;
543+ }
544+ _mi_warning_message ("environment option mimalloc_%s has an invalid value: %s\n" , desc -> name , buf );
545+ if (desc -> option == mi_option_verbose ) {
546+ desc -> value = 0 ;
547+ }
537548 }
538549 }
539550 mi_assert_internal (desc -> init != UNINIT );
You can’t perform that action at this time.
0 commit comments