[all-commits] [llvm/llvm-project] 7358c2: [flang] Check for overflows in RESHAPE folding (#6...

Leandro Lupori via All-commits all-commits at lists.llvm.org
Mon Oct 30 10:25:45 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7358c26d6acaa6c393623fde7cbc70372d0c67a8
      https://github.com/llvm/llvm-project/commit/7358c26d6acaa6c393623fde7cbc70372d0c67a8
  Author: Leandro Lupori <leandro.lupori at linaro.org>
  Date:   2023-10-30 (Mon, 30 Oct 2023)

  Changed paths:
    M flang/include/flang/Evaluate/constant.h
    M flang/include/flang/Evaluate/initial-image.h
    M flang/lib/Evaluate/constant.cpp
    M flang/lib/Evaluate/fold-designator.cpp
    M flang/lib/Evaluate/fold-implementation.h
    M flang/lib/Evaluate/initial-image.cpp
    M flang/lib/Semantics/data-to-inits.cpp
    M flang/test/Semantics/reshape.f90

  Log Message:
  -----------
  [flang] Check for overflows in RESHAPE folding (#68342)

TotalElementCount() was modified to return std::optional<uint64_t>,
where std::nullopt means overflow occurred. Besides the additional
check in RESHAPE folding, all callers of TotalElementCount() were
changed, to also check for overflows.




More information about the All-commits mailing list