[clang] [clang][bytecode] Add an assertion in initScope() op (PR #189972)
Timm Baeder via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 1 22:33:13 PDT 2026
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/189972
>From b3b33395a42fb46c9d3ca6340cc30b58524a54fc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbaeder at redhat.com>
Date: Wed, 1 Apr 2026 16:58:41 +0200
Subject: [PATCH] [clang][bytecode] Add an assertion in initScope() op
I've run into a problem in a branch lately that would've benefitted from
this assertion.
---
clang/lib/AST/ByteCode/InterpFrame.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/clang/lib/AST/ByteCode/InterpFrame.cpp b/clang/lib/AST/ByteCode/InterpFrame.cpp
index 0d429e773f88f..1c7d65dc28e02 100644
--- a/clang/lib/AST/ByteCode/InterpFrame.cpp
+++ b/clang/lib/AST/ByteCode/InterpFrame.cpp
@@ -97,6 +97,7 @@ void InterpFrame::initScope(unsigned Idx) {
return;
for (auto &Local : Func->getScope(Idx).locals()) {
+ assert(!localBlock(Local.Offset)->isInitialized());
localBlock(Local.Offset)->invokeCtor();
}
}
More information about the cfe-commits
mailing list