diff options
author | Amr Hesham <amr96@programmer.net> | 2025-05-12 21:34:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-12 21:34:35 +0200 |
commit | a4186bd04bca16a23769d9461e4b0fc1c7a03f53 (patch) | |
tree | 9b09f3929e7aa3e4d0d91699b874c121387b98a9 /clang/lib | |
parent | 39b04335ef3021399f8c0dc43837a45537b62e54 (diff) | |
download | llvm-a4186bd04bca16a23769d9461e4b0fc1c7a03f53.zip llvm-a4186bd04bca16a23769d9461e4b0fc1c7a03f53.tar.gz llvm-a4186bd04bca16a23769d9461e4b0fc1c7a03f53.tar.bz2 |
[clang][OpenMP] Add error for large expr in collapse clause (#138592)
Report error when OpenMP collapse clause has an expression that can't be
represented in 64-bit
Issue #138445
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaOpenMP.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index 9d02594..be6ce97 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -15944,6 +15944,13 @@ ExprResult SemaOpenMP::VerifyPositiveIntegerConstantInClause( << E->getSourceRange(); return ExprError(); } + + if (!Result.isRepresentableByInt64()) { + Diag(E->getExprLoc(), diag::err_omp_large_expression_in_clause) + << getOpenMPClauseNameForDiag(CKind) << E->getSourceRange(); + return ExprError(); + } + if (CKind == OMPC_collapse && DSAStack->getAssociatedLoops() == 1) DSAStack->setAssociatedLoops(Result.getExtValue()); else if (CKind == OMPC_ordered) |