aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/ExprConstant.cpp
diff options
context:
space:
mode:
authorTimm Bäder <tbaeder@redhat.com>2023-08-07 09:06:54 +0200
committerTimm Bäder <tbaeder@redhat.com>2023-10-24 06:48:09 +0200
commitaaaece65a80fb6e57cdd9a439a7ff8f1e41e14fe (patch)
tree0e35e012ad13447e8068df1ecdcbdb6ee85d4418 /clang/lib/AST/ExprConstant.cpp
parent397f1ce9efb4eea1ee10fe4833f733b8c7abd878 (diff)
downloadllvm-aaaece65a80fb6e57cdd9a439a7ff8f1e41e14fe.zip
llvm-aaaece65a80fb6e57cdd9a439a7ff8f1e41e14fe.tar.gz
llvm-aaaece65a80fb6e57cdd9a439a7ff8f1e41e14fe.tar.bz2
[clang][ExprConst] Handle 0 type size in builtin_memcpy etc.
Differential Revision: https://reviews.llvm.org/D157252
Diffstat (limited to 'clang/lib/AST/ExprConstant.cpp')
-rw-r--r--clang/lib/AST/ExprConstant.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index ce69bad..6b47b8a1 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -9545,6 +9545,8 @@ bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E,
// Figure out how many T's we're copying.
uint64_t TSize = Info.Ctx.getTypeSizeInChars(T).getQuantity();
+ if (TSize == 0)
+ return false;
if (!WChar) {
uint64_t Remainder;
llvm::APInt OrigN = N;