DPC++ daily 2021-12-21
Pre-release
Pre-release
·
136302 commits
to sycl
since this release
[SYCL][NFC] Fix static code analysis concerns (#5189) Found via a static-analysis tool: Suspicious dereference of pointer in function call before NULL check Inside checkAllowedSYCLInitializer() in SemaSYCL.cpp file: const Expr *Init = VD->getInit(); bool ValueDependent = Init->isValueDependent(); --> 'Init' is dereferenced by being passed as argument 0 to function "isValueDependent bool isConstantInit = Init && !ValueDependent && Init->isConstantInitializer(Context, false); --> 'Init' is checked for NULL here This patch adds NULL value checking for 'Init' expression. Signed-off-by: Soumi Manna <[email protected]>