[Flang][OpenMP] Avoid abort when collapse clause value is negative
authorValentin Clement <clementval@gmail.com>
Fri, 15 May 2020 01:34:33 +0000 (21:34 -0400)
committerValentin Clement <clementval@gmail.com>
Fri, 15 May 2020 01:37:25 +0000 (21:37 -0400)
commit85725a67c745cb833174a7eae2aa53e74753bcb1
tree05559bcba67aa7e17d560c2ff6731fb853123ce8
parentbf02bcffcfd7dc965e930c6a3035895823d2d78b
[Flang][OpenMP] Avoid abort when collapse clause value is negative

Summary:
If the value in the collapse close is negative f18 abort without the correct error message. This PR change the size_t in name resolution to a int64_t and check appropriately for negative or zero before the privatization of induction variable.
The correct error is then catch by the OpenMP structure check.

This diff is migrated from the GitHub pull request https://github.com/flang-compiler/f18/pull/1098

Reviewers: ichoyjx, jdoerfert, sscalpone, DavidTruby

Reviewed By: ichoyjx, sscalpone, DavidTruby

Subscribers: sscalpone, klausler, yaxunl, guansong, llvm-commits

Tags: #llvm, #flang

Differential Revision: https://reviews.llvm.org/D77821
flang/lib/Semantics/resolve-names.cpp
flang/test/Semantics/omp-clause-validity01.f90