https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/215469
We already do this later in OffsetHelper. >From 7fddcc9619e786fb0be316cae55fbf9d208bec81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= <[email protected]> Date: Tue, 11 Aug 2026 08:27:23 +0200 Subject: [PATCH] [clang][bytecode] Remove superfluous CheckArray() calls We already do this later in OffsetHelper. --- clang/lib/AST/ByteCode/Interp.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/clang/lib/AST/ByteCode/Interp.h b/clang/lib/AST/ByteCode/Interp.h index 4c8d11a9dd77a..054fba2c87c45 100644 --- a/clang/lib/AST/ByteCode/Interp.h +++ b/clang/lib/AST/ByteCode/Interp.h @@ -3457,11 +3457,6 @@ inline bool ArrayElemPtr(InterpState &S, CodePtr OpPC) { const T &Offset = S.Stk.pop<T>(); const Pointer &Ptr = S.Stk.peek<Pointer>(); - if (!Ptr.isZero() && !Offset.isZero()) { - if (!CheckArray(S, OpPC, Ptr)) - return false; - } - if (Offset.isZero()) { if (const Descriptor *Desc = Ptr.getFieldDesc(); Desc && Desc->isArray() && Ptr.getIndex() == 0) { @@ -3488,11 +3483,6 @@ inline bool ArrayElemPtrPop(InterpState &S, CodePtr OpPC) { const T &Offset = S.Stk.pop<T>(); const Pointer &Ptr = S.Stk.pop<Pointer>(); - if (!Ptr.isZero() && !Offset.isZero()) { - if (!CheckArray(S, OpPC, Ptr)) - return false; - } - if (Offset.isZero()) { if (const Descriptor *Desc = Ptr.getFieldDesc(); Desc && Desc->isArray() && Ptr.getIndex() == 0) { _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
