[PATCH] D81101: [flang] Fix crash on erroneous expressions

Tim Keith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 3 09:18:50 PDT 2020


tskeith added inline comments.


================
Comment at: flang/lib/Semantics/check-do-forall.cpp:1049
+  if (parsedExpr.typedExpr) { // typedExpr is empty on expressions with errors
+    if (const SomeExpr * expr{GetExpr(parsedExpr)}) {
+      ActualArgumentSet argSet{CollectActualArguments(*expr)};
----------------
`GetExpr` is supposed to return nullptr if the typedExpr is not present. If it's crashing the bug is inside `GetExpr`. Otherwise every call would have to be guarded with a check like this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81101





More information about the llvm-commits mailing list