aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/ByteCode/Interp.cpp
diff options
context:
space:
mode:
authorTimm Baeder <tbaeder@redhat.com>2025-08-05 08:46:22 +0200
committerGitHub <noreply@github.com>2025-08-05 08:46:22 +0200
commit8f7dfc689c4750bfffc0c57f2f8f5b69383f747b (patch)
tree13735506478b37946aa61fef0d760764e9882a8a /clang/lib/AST/ByteCode/Interp.cpp
parent95d9e8af64bc8e3f257553e2da01388bb72823fe (diff)
downloadllvm-8f7dfc689c4750bfffc0c57f2f8f5b69383f747b.zip
llvm-8f7dfc689c4750bfffc0c57f2f8f5b69383f747b.tar.gz
llvm-8f7dfc689c4750bfffc0c57f2f8f5b69383f747b.tar.bz2
[clang][bytecode] Call CheckLocalLoad in GetLocal (#152090)
I forgot to call this here as well. It was only used in the EvalEmitter implementation of the function. Also fix a problem where we didn't diagnose out-of-lifetime reads here.
Diffstat (limited to 'clang/lib/AST/ByteCode/Interp.cpp')
-rw-r--r--clang/lib/AST/ByteCode/Interp.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/AST/ByteCode/Interp.cpp b/clang/lib/AST/ByteCode/Interp.cpp
index f2366f6..eb4e480 100644
--- a/clang/lib/AST/ByteCode/Interp.cpp
+++ b/clang/lib/AST/ByteCode/Interp.cpp
@@ -752,6 +752,8 @@ bool CheckGlobalLoad(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
// Similarly, for local loads.
bool CheckLocalLoad(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
+ if (!CheckLifetime(S, OpPC, Ptr, AK_Read))
+ return false;
if (!CheckInitialized(S, OpPC, Ptr, AK_Read))
return false;
if (!CheckVolatile(S, OpPC, Ptr, AK_Read))