[flang] Quick additional fix for crashes on statement functions without arguments

Original-commit: flang-compiler/f18@79779967a9
Reviewed-on: https://github.com/flang-compiler/f18/pull/548
This commit is contained in:
peter klausler 2019-07-03 13:04:56 -07:00
parent c180c0229f
commit 24eb863fda

View file

@ -215,6 +215,10 @@ Statement<ActionStmt> StmtFunctionStmt::ConvertToAssignment() {
source.ExtendToCover(arg.source);
}
// extend source to include closing paren
if (funcArgs.empty()) {
CHECK(*source.end() == '(');
source = CharBlock{source.begin(), source.end() + 1};
}
CHECK(*source.end() == ')');
source = CharBlock{source.begin(), source.end() + 1};
auto variable{Variable{common::Indirection{WithSource(