[clang] [clang][bytecode] Handle negative array sizes in constexpr `new` instead of asserting (PR #155737)
Timm Baeder via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 28 22:58:31 PDT 2025
================
@@ -3490,7 +3490,15 @@ inline bool AllocN(InterpState &S, CodePtr OpPC, PrimType T, const Expr *Source,
S.Stk.push<Pointer>(0, nullptr);
return true;
}
- assert(NumElements.isPositive());
+ if (!NumElements.isPositive()) {
----------------
tbaederr wrote:
```suggestion
if (NumElements.isNegative()) {
```
https://github.com/llvm/llvm-project/pull/155737
More information about the cfe-commits
mailing list