[all-commits] [llvm/llvm-project] a82341: [flang] Restore checking for some optional values ...

Peter Klausler via All-commits all-commits at lists.llvm.org
Thu Dec 29 09:37:54 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a8234196c58396c0505ac93983dafee743a67b11
      https://github.com/llvm/llvm-project/commit/a8234196c58396c0505ac93983dafee743a67b11
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2022-12-29 (Thu, 29 Dec 2022)

  Changed paths:
    M flang/include/flang/Evaluate/tools.h
    M flang/lib/Lower/Bridge.cpp
    M flang/lib/Lower/ConvertCall.cpp
    M flang/lib/Lower/ConvertExpr.cpp
    M flang/lib/Lower/ConvertExprToHLFIR.cpp
    M flang/lib/Lower/CustomIntrinsicCall.cpp

  Log Message:
  -----------
  [flang] Restore checking for some optional values before use

Recent commits (2098ad7f00324ee0f2a6538f418a6f81dfdd2edb and
15a9a72ee68166c0cff3f036cacd3c82be66c729) replaced usage of "o.value()"
on optionals with "*o".  Those optional values are expected to be
present -- but now, if it ever turns out that they're not,
compilation will proceed with garbage data rather than crashing
immediately (and more debuggably) with an uncaught exception.

Add asserts for presence to restore the previous level of safety.
(I could have revert these patches so as to resume used of .value()
but I didn't want to just have them get broken again.)

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




More information about the All-commits mailing list