[clang] 20e97c4 - [clang][bytecode] Remove superfluous CheckArray() calls (#215469)

via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 11 01:13:32 PDT 2026


Author: Timm Baeder
Date: 2026-08-11T10:13:26+02:00
New Revision: 20e97c4b113b79586c29ac57738548939a34d22e

URL: https://github.com/llvm/llvm-project/commit/20e97c4b113b79586c29ac57738548939a34d22e
DIFF: https://github.com/llvm/llvm-project/commit/20e97c4b113b79586c29ac57738548939a34d22e.diff

LOG: [clang][bytecode] Remove superfluous CheckArray() calls (#215469)

We already do this later in OffsetHelper.

Added: 
    

Modified: 
    clang/lib/AST/ByteCode/Interp.h

Removed: 
    


################################################################################
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) {


        


More information about the cfe-commits mailing list