[OpenMP] Fix potential integer overflow in dynamic schedule code
authorPeyton, Jonathan L <jonathan.l.peyton@intel.com>
Mon, 1 Feb 2021 20:08:51 +0000 (14:08 -0600)
committerPeyton, Jonathan L <jonathan.l.peyton@intel.com>
Mon, 8 Mar 2021 15:43:05 +0000 (09:43 -0600)
commite2738b3758a9d5a6dfdc5a6768046b44a1b9f135
treee5d56a9fd384f7a92e1320a415f05517004de94f
parentb0f0115308e4e8692b254c3b0e20f3743616b2d5
[OpenMP] Fix potential integer overflow in dynamic schedule code

Restrict the chunk_size * chunk_num to only occur for valid
chunk_nums and reimplement calculating the limit to avoid overflow.

Differential Revision: https://reviews.llvm.org/D96747
openmp/runtime/src/kmp_dispatch.cpp
openmp/runtime/test/worksharing/for/omp_for_dynamic_large_chunk.c [new file with mode: 0644]