[clang] [clang][bytecode] Fix `Pointer::getLifetime()` for non-primitive array elements (PR #232605)

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 18 01:17:27 PDT 2026


================
@@ -769,7 +769,7 @@ Lifetime PtrView::getLifetime() const {
   if (Base < sizeof(InlineDescriptor))
     return Lifetime::Started;
 
-  if (inArray() && !isArrayRoot()) {
+  if (getFieldDesc()->isPrimitiveArray() && !isArrayRoot()) {
----------------
ojhunt wrote:

Is it worth have `inPrimitiveArray()`? and then a different name for `inArray()`? It seems like having a generically named `inArray()` method is a footgun if we really need to care about the kind of array being examined?

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


More information about the cfe-commits mailing list