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.
Specifically, if an actual argument was a function call, I wasn't recursing
through the arguments of the called function. I fixed this by recursing
through the argument in the member function in
CollectActualArgumentsHelper.
This should be a member of DoForallChecker. It isn't meaningful outside of that class.