Fix possible device nullptr dereference

- abort will be called if device is nullptr

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe 2020-11-26 16:51:14 +01:00 committed by Compute-Runtime-Automation
parent ba89a47aea
commit 8cac8d4b51
1 changed files with 1 additions and 1 deletions

View File

@ -65,9 +65,9 @@ ModuleTranslationUnit::~ModuleTranslationUnit() {
bool ModuleTranslationUnit::buildFromSpirV(const char *input, uint32_t inputSize, const char *buildOptions, const char *internalBuildOptions,
const ze_module_constants_t *pConstants) {
UNRECOVERABLE_IF((nullptr == device) || (nullptr == device->getNEODevice()));
auto compilerInterface = device->getNEODevice()->getCompilerInterface();
UNRECOVERABLE_IF(nullptr == compilerInterface);
UNRECOVERABLE_IF((nullptr == device) || (nullptr == device->getNEODevice()));
if (nullptr != buildOptions) {
options = buildOptions;