diff options
author | Timm Baeder <tbaeder@redhat.com> | 2025-08-05 08:46:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-05 08:46:22 +0200 |
commit | 8f7dfc689c4750bfffc0c57f2f8f5b69383f747b (patch) | |
tree | 13735506478b37946aa61fef0d760764e9882a8a /clang/lib/AST/ByteCode/Interp.cpp | |
parent | 95d9e8af64bc8e3f257553e2da01388bb72823fe (diff) | |
download | llvm-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.cpp | 2 |
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)) |