aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/ByteCode/Interp.cpp
diff options
context:
space:
mode:
authorTimm Baeder <tbaeder@redhat.com>2025-05-15 15:43:07 +0200
committerGitHub <noreply@github.com>2025-05-15 15:43:07 +0200
commit9a26dff74834d6c3d9d72eac10e2f2479014ebca (patch)
tree568b06a817fedb5f226df9105f0ea8daa519a8d2 /clang/lib/AST/ByteCode/Interp.cpp
parent636628d8fde45fc2bb99a1016f7503d0e744ab89 (diff)
downloadllvm-9a26dff74834d6c3d9d72eac10e2f2479014ebca.zip
llvm-9a26dff74834d6c3d9d72eac10e2f2479014ebca.tar.gz
llvm-9a26dff74834d6c3d9d72eac10e2f2479014ebca.tar.bz2
[clang][bytecode] Check dtor calls for one-past-end pointers (#140047)
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 fbe04fe..74efc3c9 100644
--- a/clang/lib/AST/ByteCode/Interp.cpp
+++ b/clang/lib/AST/ByteCode/Interp.cpp
@@ -1375,6 +1375,8 @@ bool CheckDestructor(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
return false;
if (!CheckTemporary(S, OpPC, Ptr, AK_Destroy))
return false;
+ if (!CheckRange(S, OpPC, Ptr, AK_Destroy))
+ return false;
// Can't call a dtor on a global variable.
if (Ptr.block()->isStatic()) {