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(
320320 } else { // Assume that we encountered some scalar element
321321 int NumBytes = Ty->getScalarSizeInBits () / CHAR_BIT +
322322 (Ty->getScalarSizeInBits () % 8 != 0 );
323- char *CharPtr;
323+ char *CharPtr = nullptr ;
324324
325325 if (auto IntConst = dyn_cast<ConstantInt>(C)) {
326326 auto Val = IntConst->getValue ().getZExtValue ();
@@ -336,6 +336,7 @@ void collectCompositeElementsDefaultValuesRecursive(
336336 CharPtr = reinterpret_cast <char *>(&v);
337337 }
338338 }
339+ assert (CharPtr && " Unexpected constant type" );
339340 std::copy_n (CharPtr, NumBytes, std::back_inserter (DefaultValues));
340341 Offset += NumBytes;
341342 }
You can’t perform that action at this time.
0 commit comments