[clang] [clang][bytecode] Allocate operator new data as array (PR #146471)
Shafik Yaghmour via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 8 15:17:53 PDT 2025
================
@@ -1567,10 +1554,17 @@ static bool interp__builtin_operator_new(InterpState &S, CodePtr OpPC,
return true;
}
+ // Records. Still allocate them as single-element arrays.
+ QualType AllocType = S.getASTContext().getConstantArrayType(
+ ElemType, NumElems, nullptr, ArraySizeModifier::Normal, 0);
+
+ const Descriptor *Desc =
+ S.P.createDescriptor(NewCall, AllocType.getTypePtr(),
+ IsArray ? std::nullopt : Descriptor::InlineDescMD);
----------------
shafik wrote:
This `IsArray` check is outside the `if (IsArray)` block which has a return and so this has to be `false`.
https://github.com/llvm/llvm-project/pull/146471
More information about the cfe-commits
mailing list