File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
llvm/tools/sycl-post-link Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -320,7 +320,7 @@ void collectCompositeElementsDefaultValuesRecursive(
320
320
} else { // Assume that we encountered some scalar element
321
321
int NumBytes = Ty->getScalarSizeInBits () / CHAR_BIT +
322
322
(Ty->getScalarSizeInBits () % 8 != 0 );
323
- char *CharPtr;
323
+ char *CharPtr = nullptr ;
324
324
325
325
if (auto IntConst = dyn_cast<ConstantInt>(C)) {
326
326
auto Val = IntConst->getValue ().getZExtValue ();
@@ -336,6 +336,7 @@ void collectCompositeElementsDefaultValuesRecursive(
336
336
CharPtr = reinterpret_cast <char *>(&v);
337
337
}
338
338
}
339
+ assert (CharPtr && " Unexpected constant type" );
339
340
std::copy_n (CharPtr, NumBytes, std::back_inserter (DefaultValues));
340
341
Offset += NumBytes;
341
342
}
You can’t perform that action at this time.
0 commit comments