================
@@ -39,9 +39,11 @@ Block *DynamicAllocator::allocate(const Expr *Source, 
PrimType T,
                                   Form AllocForm) {
   // Create a new descriptor for an array of the specified size and
   // element type.
-  const Descriptor *D = allocateDescriptor(
-      Source, T, Descriptor::InlineDescMD, NumElements, /*IsConst=*/false,
-      /*IsTemporary=*/false, /*IsMutable=*/false);
+  const Descriptor *D =
+      allocateDescriptor(Source, nullptr, T, Descriptor::InlineDescMD,
----------------
tbaederr wrote:

We do that on demand in `Descriptor::getDataType()`. I think the source here is 
always a `CXXNewExpr` or `CallExpr` (for `std::allocator`) here. In practice, 
we should avoid calling `getType()` during normal evaluation. It's a bit 
unfortunate but right now `getType()` basically returns the wrong thing for 
dynamically allocated arrays like that and we need to call `getDataType()` in 
that case. But I think this is only the case because we don't have  an 
`ASTContext` in `getType()` available and we _should_ fix _that_ at some point.

https://github.com/llvm/llvm-project/pull/200342
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to