Timm =?utf-8?q?Bäder?= <tbae...@redhat.com> Message-ID: In-Reply-To: <llvm/llvm-project/pull/70306/cl...@github.com>
================ @@ -1990,6 +2011,79 @@ inline bool OffsetOf(InterpState &S, CodePtr OpPC, const OffsetOfExpr *E) { return true; } +inline bool Alloc(InterpState &S, CodePtr OpPC, const Descriptor *Desc) { + assert(Desc); + + if (!CheckDynamicMemoryAllocation(S, OpPC)) + return false; + + DynamicAllocator &Allocator = S.getAllocator(); + Block *B = Allocator.allocate(Desc); + + S.Stk.push<Pointer>(B, sizeof(InlineDescriptor)); + + return true; +} + +template <PrimType Name, class SizeT = typename PrimConv<Name>::T> +inline bool AllocN(InterpState &S, CodePtr OpPC, PrimType T, + const Expr *Source) { + if (!CheckDynamicMemoryAllocation(S, OpPC)) + return false; ---------------- tbaederr wrote: I need to do that for stack allocated arrays as well. Noted. https://github.com/llvm/llvm-project/pull/70306 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits