[all-commits] [llvm/llvm-project] 3091ed: [OpenMP] Fixed a potential integer overflow

Shilei Tian via All-commits all-commits at lists.llvm.org
Thu Oct 22 18:22:35 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3091ed099f2f6a3d16dbdae7d0406f54dfc3031f
      https://github.com/llvm/llvm-project/commit/3091ed099f2f6a3d16dbdae7d0406f54dfc3031f
  Author: Shilei Tian <tianshilei1992 at gmail.com>
  Date:   2020-10-22 (Thu, 22 Oct 2020)

  Changed paths:
    M openmp/libomptarget/src/MemoryManager.cpp

  Log Message:
  -----------
  [OpenMP] Fixed a potential integer overflow

`size_t` has different width on 32- and 64-bit architecture, but the
computation to floor to power of two assumed it is 64-bit, which can cause an
integer overflow. In this patch, architecture detection is added so that the
operation for 64-bit `size_t`. Thank Luke for reporting the issue.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D89878




More information about the All-commits mailing list