https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/174368
A null Pointee shouldn't happen anymore. >From 5899a48dc8d065dfb1772f7aebd444b29a569108 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= <[email protected]> Date: Mon, 5 Jan 2026 08:47:58 +0100 Subject: [PATCH] [clang][bytecode] Remove unnecessary null check A null Pointee shouldn't happen anymore. --- clang/lib/AST/ByteCode/Pointer.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/clang/lib/AST/ByteCode/Pointer.cpp b/clang/lib/AST/ByteCode/Pointer.cpp index 2e38c1bb65d36..5d11321d09079 100644 --- a/clang/lib/AST/ByteCode/Pointer.cpp +++ b/clang/lib/AST/ByteCode/Pointer.cpp @@ -33,13 +33,12 @@ Pointer::Pointer(Block *Pointee, uint64_t BaseAndOffset) Pointer::Pointer(Block *Pointee, unsigned Base, uint64_t Offset) : Offset(Offset), StorageKind(Storage::Block) { + assert(Pointee); assert((Base == RootPtrMark || Base % alignof(void *) == 0) && "wrong base"); assert(Base >= Pointee->getDescriptor()->getMetadataSize()); BS = {Pointee, Base, nullptr, nullptr}; - - if (Pointee) - Pointee->addPointer(this); + Pointee->addPointer(this); } Pointer::Pointer(const Pointer &P) _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
