Author: Timm Baeder
Date: 2026-06-17T07:11:49+02:00
New Revision: 4a3052bd23438b6d6bb9ef561f8b447224d8ea01

URL: 
https://github.com/llvm/llvm-project/commit/4a3052bd23438b6d6bb9ef561f8b447224d8ea01
DIFF: 
https://github.com/llvm/llvm-project/commit/4a3052bd23438b6d6bb9ef561f8b447224d8ea01.diff

LOG: [clang][bytecode][NFC] Fix Pointer::operator<< for non-block pointers 
(#204156)

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ByteCode/Pointer.h 
b/clang/lib/AST/ByteCode/Pointer.h
index cae3f7476ec83..d4d92d62c0146 100644
--- a/clang/lib/AST/ByteCode/Pointer.h
+++ b/clang/lib/AST/ByteCode/Pointer.h
@@ -1103,14 +1103,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