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

... even when we're not performing a lvalue-to-rvalue conversion.

>From 3d42d2f1e9e70f5836e1f10be9b18c986c4394f7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbae...@redhat.com>
Date: Fri, 31 Jan 2025 17:37:17 +0100
Subject: [PATCH] [clang][bytecode] Return failure for dead non-temporary
 pointers

... even when we're not performing a lvalue-to-rvalue conversion.
---
 clang/lib/AST/ByteCode/EvalEmitter.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/clang/lib/AST/ByteCode/EvalEmitter.cpp 
b/clang/lib/AST/ByteCode/EvalEmitter.cpp
index 9763fe89b73742..8134bbf270363e 100644
--- a/clang/lib/AST/ByteCode/EvalEmitter.cpp
+++ b/clang/lib/AST/ByteCode/EvalEmitter.cpp
@@ -174,6 +174,9 @@ template <> bool EvalEmitter::emitRet<PT_Ptr>(const 
SourceInfo &Info) {
       return false;
     }
   } else {
+    if (!Ptr.isLive() && !Ptr.isTemporary())
+      return false;
+
     EvalResult.setValue(Ptr.toAPValue(Ctx.getASTContext()));
   }
 

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to