shafik added inline comments.
================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:737
+ auto ArrayType = IVIE->getType()->getAsArrayTypeUnsafe();
+ const auto *CAT = dyn_cast<ConstantArrayType>(ArrayType);
+ const size_t NumElems = CAT->getSize().getZExtValue();
----------------
I believe you should check `ArrayType` before you use it.
================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:748
+ } else {
+ assert(false && "default initializer for non-primitive type");
+ }
----------------
I guess this covers both arrays and class types?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D135013/new/
https://reviews.llvm.org/D135013
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits