aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/ByteCode/Interp.cpp
diff options
context:
space:
mode:
authorTimm Baeder <tbaeder@redhat.com>2025-09-28 07:21:40 +0200
committerGitHub <noreply@github.com>2025-09-28 07:21:40 +0200
commitc7504872927486bb70c26aa71f795b1331cbbd38 (patch)
treee34f8e2eb7bf2a0e1707fd06f9c00e9b60efe2f0 /clang/lib/AST/ByteCode/Interp.cpp
parent4edda3d78c26b9d928d115b2059d0c719eec237b (diff)
downloadllvm-c7504872927486bb70c26aa71f795b1331cbbd38.zip
llvm-c7504872927486bb70c26aa71f795b1331cbbd38.tar.gz
llvm-c7504872927486bb70c26aa71f795b1331cbbd38.tar.bz2
[clang][bytecode] Diagnose volatile writes (#160350)
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 8aaefc7..21af3d6 100644
--- a/clang/lib/AST/ByteCode/Interp.cpp
+++ b/clang/lib/AST/ByteCode/Interp.cpp
@@ -889,6 +889,8 @@ bool CheckStore(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
return false;
if (!CheckConst(S, OpPC, Ptr))
return false;
+ if (!CheckVolatile(S, OpPC, Ptr, AK_Assign))
+ return false;
if (!S.inConstantContext() && isConstexprUnknown(Ptr))
return false;
return true;