[clang] [clang][bytecode] Remove incorrect assertion (PR #145341)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 23 08:30:43 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Timm Baeder (tbaederr)

<details>
<summary>Changes</summary>

P.block() will assert that P is a block pointer, which it doesn't have to be here.

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


1 Files Affected:

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


``````````diff
diff --git a/clang/lib/AST/ByteCode/Pointer.cpp b/clang/lib/AST/ByteCode/Pointer.cpp
index 50453c72c582b..f0b0384f32ac8 100644
--- a/clang/lib/AST/ByteCode/Pointer.cpp
+++ b/clang/lib/AST/ByteCode/Pointer.cpp
@@ -114,7 +114,6 @@ void Pointer::operator=(Pointer &&P) {
     }
 
     if (Block *Pointee = PointeeStorage.BS.Pointee) {
-      assert(P.block() != this->block());
       Pointee->removePointer(this);
       PointeeStorage.BS.Pointee = nullptr;
       Pointee->cleanup();

``````````

</details>


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


More information about the cfe-commits mailing list