https://github.com/tbaederr updated 
https://github.com/llvm/llvm-project/pull/184141

>From 2f1eac807329ecbe95eafb028423504c85a0ceb9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <[email protected]>
Date: Mon, 2 Mar 2026 15:49:51 +0100
Subject: [PATCH] [clang][bytecode] Reject non-VarDecl DeclRefExprs

I have no idea how to test this, but this is what the current
interpreter does.
---
 clang/lib/AST/ByteCode/Compiler.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/AST/ByteCode/Compiler.cpp 
b/clang/lib/AST/ByteCode/Compiler.cpp
index 70d3d80b806d1..828f89c96c91b 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -7293,7 +7293,7 @@ bool Compiler<Emitter>::visitDeclRef(const ValueDecl *D, 
const Expr *E) {
   // we haven't seen yet.
   const auto *VD = dyn_cast<VarDecl>(D);
   if (!VD)
-    return this->emitDummyPtr(D, E);
+    return this->emitInvalid(E);
 
   // For C.
   if (!Ctx.getLangOpts().CPlusPlus) {

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to