llvm-project/flang/lib
Pete Steinfeld 4d8c00c059 [flang] Fix crash on erroneous expressions
Summary:
If you create an expression with parse errors, the `parser::Expr.typedExpr`
will be empty, which causes a compiler crash.  The crash is caused by the
check in check-do-forall.cpp that scans all expresssions to see if `DO`
variables are being modified.

It turned out that the problem was that I was fetching subexpressions of type
`parser::Expr`, which are not guaranteed to have a non-null `typedExpr`.  I
fixed this by only grabbing the top-level expression from which to gather
arguments as part of the DO loop analysis.  This, in turn, exposed a problem
where I wasn't collecting all of the actual arguments in an expression.  This
was caused by the fact that I wasn't recursing through the rest of the
expression after finding an argument.  I fixed this by recursing through the
argument in the member function in `CollectActualArgumentsHelper`.

Reviewers: klausler, tskeith, DavidTruby

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81101
2020-06-05 08:46:43 -07:00
..
Common [flang] Use the Flang cmake-functions to add targets. 2020-04-16 15:51:30 +01:00
Decimal [flang] avoid GCC < 8 compiler failure after D80794 2020-06-04 14:48:39 -04:00
Evaluate [flang] Fixed crash on forward referenced `len` parameter 2020-06-04 13:12:11 -07:00
Lower [flang] Add the conversions for types. 2020-06-04 12:54:50 -07:00
Optimizer [mlir] Add NamedAttrList 2020-05-07 12:33:36 -07:00
Parser [flang] Fix handling of files without terminating newlines. 2020-04-27 12:40:22 +01:00
Semantics [flang] Fix crash on erroneous expressions 2020-06-05 08:46:43 -07:00
CMakeLists.txt [flang] A rework of the cmake build components for in and out of tree builds. 2020-03-26 18:17:04 +00:00