Skip to content

Commit 4f1b7e9

Browse files
committed
Fix potential SIOF issue with checker layers
Since the order of global initialization is undefined, the context variable, accessed directly from the events and leak checkers, might be unitialized. This patch fixes this by using the getInstance() accessor method that makes sure that the validation layer context is initialized before use.
1 parent 1357333 commit 4f1b7e9

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

source/layers/validation/checkers/basic_leak/zel_basic_leak_checker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace validation_layer
2626
basic_leak_checker.zeValidation = zeChecker;
2727
basic_leak_checker.zetValidation = zetChecker;
2828
basic_leak_checker.zesValidation = zesChecker;
29-
validation_layer::context.validationHandlers.push_back(&basic_leak_checker);
29+
validation_layer::context.getInstance().validationHandlers.push_back(&basic_leak_checker);
3030
}
3131
}
3232

source/layers/validation/checkers/events_checker/zel_events_checker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ eventsChecker::eventsChecker() {
2525
events_checker.zesValidation = zesChecker;
2626
events_checker.zetValidation = zetChecker;
2727

28-
validation_layer::context.validationHandlers.push_back(&events_checker);
28+
validation_layer::context.getInstance().validationHandlers.push_back(&events_checker);
2929
}
3030
}
3131

0 commit comments

Comments
 (0)