aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/ByteCode/Interp.cpp
diff options
context:
space:
mode:
authorTimm Baeder <tbaeder@redhat.com>2025-04-18 12:48:16 +0200
committerGitHub <noreply@github.com>2025-04-18 12:48:16 +0200
commitc5d59723cbf9743f7a0534a6ca87383abb6785a7 (patch)
tree1b8a5ad448bbce038c18119442daeb9dcb1750bd /clang/lib/AST/ByteCode/Interp.cpp
parent1d190065d92a7cc9fbe322edbfa233c2318c8839 (diff)
downloadllvm-c5d59723cbf9743f7a0534a6ca87383abb6785a7.zip
llvm-c5d59723cbf9743f7a0534a6ca87383abb6785a7.tar.gz
llvm-c5d59723cbf9743f7a0534a6ca87383abb6785a7.tar.bz2
[clang][bytecode] Reject constexpr-unknown values in CheckStore (#136279)
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 4625154..b755a07 100644
--- a/clang/lib/AST/ByteCode/Interp.cpp
+++ b/clang/lib/AST/ByteCode/Interp.cpp
@@ -790,6 +790,8 @@ bool CheckStore(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
return false;
if (!CheckConst(S, OpPC, Ptr))
return false;
+ if (!S.inConstantContext() && isConstexprUnknown(Ptr))
+ return false;
return true;
}