[PATCH] D84352: [flang] Fix an assert when RESHAPE() is called on empty strings

Pete Steinfeld via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 22 12:06:01 PDT 2020


PeteSteinfeld marked an inline comment as done.
PeteSteinfeld added inline comments.


================
Comment at: flang/lib/Evaluate/constant.cpp:257
+    while (copied < count) {
+      if (copied < values_.size()) {
+        auto *dest{&values_.at(SubscriptsToOffset(resultSubscripts) * length_)};
----------------
klausler wrote:
> This new 'if' statement might just hide bugs.  Can `copied` be >= `values_.size()` and still be valid?
Oops.  This `if` is a left-over from an earlier attempt to fix this problem.  It's unnecessary now, and I'll remove it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84352/new/

https://reviews.llvm.org/D84352





More information about the llvm-commits mailing list