[clang] [clang][bytecode][NFC] Return nullptr instead of {} (PR #176912)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 20 04:15:23 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Timm Baeder (tbaederr)

<details>
<summary>Changes</summary>



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


1 Files Affected:

- (modified) clang/lib/AST/ByteCode/Program.cpp (+2-2) 


``````````diff
diff --git a/clang/lib/AST/ByteCode/Program.cpp b/clang/lib/AST/ByteCode/Program.cpp
index d038c30d1ef82..76fec63a8920d 100644
--- a/clang/lib/AST/ByteCode/Program.cpp
+++ b/clang/lib/AST/ByteCode/Program.cpp
@@ -412,7 +412,7 @@ Descriptor *Program::createDescriptor(const DeclTy &D, const Type *Ty,
         // Arrays of primitives.
         unsigned ElemSize = primSize(*T);
         if ((Descriptor::MaxArrayElemBytes / ElemSize) < NumElems) {
-          return {};
+          return nullptr;
         }
         return allocateDescriptor(D, *T, MDSize, NumElems, IsConst, IsTemporary,
                                   IsMutable);
@@ -425,7 +425,7 @@ Descriptor *Program::createDescriptor(const DeclTy &D, const Type *Ty,
           return nullptr;
         unsigned ElemSize = ElemDesc->getAllocSize() + sizeof(InlineDescriptor);
         if (std::numeric_limits<unsigned>::max() / ElemSize <= NumElems)
-          return {};
+          return nullptr;
         return allocateDescriptor(D, Ty, ElemDesc, MDSize, NumElems, IsConst,
                                   IsTemporary, IsMutable);
     }

``````````

</details>


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


More information about the cfe-commits mailing list