[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 08:00:43 PDT 2026
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/189972
I've run into a problem in a branch lately that would've benefitted from this assertion.
>From 4f1550ca7decfd5518e3bf738f8f3f6ee511f763 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