[clang] [clang][bytecode][NFC] Make string pointer check more explicit (PR #233360)

via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 19 00:39:36 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Timm Baeder (tbaederr)

<details>
<summary>Changes</summary>

We already handled block pointers above, so the isReadablePointerType() check here is equivalent to isStringPointer().

---
Full diff: https://github.com/llvm/llvm-project/pull/233360.diff


1 Files Affected:

- (modified) clang/lib/AST/ByteCode/Interp.cpp (+1-1) 


``````````diff
diff --git a/clang/lib/AST/ByteCode/Interp.cpp b/clang/lib/AST/ByteCode/Interp.cpp
index c5cc90f5fdd7f..b3ecbe9b898e8 100644
--- a/clang/lib/AST/ByteCode/Interp.cpp
+++ b/clang/lib/AST/ByteCode/Interp.cpp
@@ -1024,7 +1024,7 @@ bool CheckLoad(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
   }
 
   // Block and string pointers are the only ones we can actually read from.
-  if (!Ptr.isReadablePointerType())
+  if (!Ptr.isStringPointer())
     return diagnoseDummy(S, OpPC, Ptr, AK);
 
   assert(Ptr.isStringPointer());

``````````

</details>


https://github.com/llvm/llvm-project/pull/233360


More information about the cfe-commits mailing list