[all-commits] [llvm/llvm-project] 19d7cc: [flang] Fix assert on character literal substrings...

Pete Steinfeld via All-commits all-commits at lists.llvm.org
Thu Aug 13 09:09:39 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 19d7cc2e83061050923057abf72ab860bdc0a3b5
      https://github.com/llvm/llvm-project/commit/19d7cc2e83061050923057abf72ab860bdc0a3b5
  Author: Peter Steinfeld <psteinfeld at nvidia.com>
  Date:   2020-08-13 (Thu, 13 Aug 2020)

  Changed paths:
    M flang/lib/Evaluate/variable.cpp
    M flang/test/Semantics/resolve49.f90

  Log Message:
  -----------
  [flang] Fix assert on character literal substrings as arguments

Character literal substrings used as arguments were causing asserts.  This
happened when the code was trying to get the DynamicType of the substring.  We
were only recording the DynamicType of the Designator on which the substring
was based.  For character literal substrings, the Designator was a character
literal, and we weren't handling getting its type.

I fixed this by changing the `GetType()` method for `DynamicType` to check to
see if we were getting the type of a `Substring` and calculating the type of
the substring by getting the number of bytes in an element of the string.

I also changed the test `resolve49.f90` with some tests, one of which causes
the original crash.

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




More information about the All-commits mailing list