diff options
author | Lucile Nihlen <luci.the.rose@gmail.com> | 2023-06-30 19:48:40 +0000 |
---|---|---|
committer | Lucile Nihlen <luci.the.rose@gmail.com> | 2023-06-30 23:19:04 +0000 |
commit | b776e2a0b03e93c45deb92f36a391d457ae5b43f (patch) | |
tree | b70597f690e3cdaf256212dc4393ee1cf536868d /clang/lib/Sema/SemaChecking.cpp | |
parent | a57bdc8fe68753c341cac0fcecabcd4d35e45466 (diff) | |
download | llvm-b776e2a0b03e93c45deb92f36a391d457ae5b43f.zip llvm-b776e2a0b03e93c45deb92f36a391d457ae5b43f.tar.gz llvm-b776e2a0b03e93c45deb92f36a391d457ae5b43f.tar.bz2 |
[clang] detect integer overflow through temporary values
Fixes #63629.
Differential Revision: https://reviews.llvm.org/D154253
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index ffda87a..09ce790 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -15212,6 +15212,8 @@ void Sema::CheckForIntOverflow (Expr *E) { Exprs.append(Message->arg_begin(), Message->arg_end()); else if (auto Construct = dyn_cast<CXXConstructExpr>(E)) Exprs.append(Construct->arg_begin(), Construct->arg_end()); + else if (auto Temporary = dyn_cast<CXXBindTemporaryExpr>(E)) + Exprs.push_back(Temporary->getSubExpr()); else if (auto Array = dyn_cast<ArraySubscriptExpr>(E)) Exprs.push_back(Array->getIdx()); else if (auto Compound = dyn_cast<CompoundLiteralExpr>(E)) |