We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f7d1a6 commit e3c1096Copy full SHA for e3c1096
llvm/tools/sycl-post-link/SpecConstants.cpp
@@ -320,7 +320,7 @@ void collectCompositeElementsDefaultValuesRecursive(
320
} else { // Assume that we encountered some scalar element
321
int NumBytes = Ty->getScalarSizeInBits() / CHAR_BIT +
322
(Ty->getScalarSizeInBits() % 8 != 0);
323
- char *CharPtr;
+ char *CharPtr = nullptr;
324
325
if (auto IntConst = dyn_cast<ConstantInt>(C)) {
326
auto Val = IntConst->getValue().getZExtValue();
@@ -336,6 +336,7 @@ void collectCompositeElementsDefaultValuesRecursive(
336
CharPtr = reinterpret_cast<char *>(&v);
337
}
338
339
+ assert(CharPtr && "Unexpected constant type");
340
std::copy_n(CharPtr, NumBytes, std::back_inserter(DefaultValues));
341
Offset += NumBytes;
342
0 commit comments