https://github.com/tbaederr created 
https://github.com/llvm/llvm-project/pull/204156

Some of those functions can only be called on block pointers.

>From 2cd8276cb18baa82f79d9179fe6a10027d288c89 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <[email protected]>
Date: Tue, 16 Jun 2026 15:55:07 +0200
Subject: [PATCH] [clang][bytecode][NFC] Fix Pointer::operator<< for non-block
 pointers

Some of those functions can only be called on block pointers.
---
 clang/lib/AST/ByteCode/Pointer.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/lib/AST/ByteCode/Pointer.h b/clang/lib/AST/ByteCode/Pointer.h
index 0fd8082c73d69..e030e187ba799 100644
--- a/clang/lib/AST/ByteCode/Pointer.h
+++ b/clang/lib/AST/ByteCode/Pointer.h
@@ -1099,14 +1099,14 @@ inline llvm::raw_ostream &operator<<(llvm::raw_ostream 
&OS, const Pointer &P) {
       std::reverse(Indices.begin(), Indices.end());
       OS << Indices;
     }
-  } else if (P.isArrayRoot())
+  } else if (P.isBlockPointer() && P.isArrayRoot())
     OS << " arrayroot";
 
   if (P.isBlockPointer() && P.block() && P.block()->isDummy())
     OS << " dummy";
   if (!P.isLive())
     OS << " dead";
-  if (P.isBaseClass())
+  if (P.isBlockPointer() && P.isBaseClass())
     OS << " base-class";
   return OS;
 }

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to