[clang] a85dbcf - [clang][bytecode] Reject non-VarDecl DeclRefExprs (#184141)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 2 20:19:33 PST 2026
Author: Timm Baeder
Date: 2026-03-03T05:19:29+01:00
New Revision: a85dbcfe016d8cce9bfea0d9265f3f69c40572e7
URL: https://github.com/llvm/llvm-project/commit/a85dbcfe016d8cce9bfea0d9265f3f69c40572e7
DIFF: https://github.com/llvm/llvm-project/commit/a85dbcfe016d8cce9bfea0d9265f3f69c40572e7.diff
LOG: [clang][bytecode] Reject non-VarDecl DeclRefExprs (#184141)
I have no idea how to test this, but this is what the current
interpreter does.
Added:
Modified:
clang/lib/AST/ByteCode/Compiler.cpp
Removed:
################################################################################
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp
index 70d3d80b806d1..e33fa4f86c052 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->emitError(E);
// For C.
if (!Ctx.getLangOpts().CPlusPlus) {
More information about the cfe-commits
mailing list