[flang] Fix bug

Original-commit: flang-compiler/f18@662b8139b5
Reviewed-on: https://github.com/flang-compiler/f18/pull/926
Tree-same-pre-rewrite: false
This commit is contained in:
peter klausler 2020-01-13 15:39:18 -08:00
parent c2bdc144c5
commit 7010fff8de
1 changed files with 6 additions and 1 deletions

View File

@ -2801,7 +2801,12 @@ void SubprogramVisitor::PushBlockDataScope(const parser::Name &name) {
EraseSymbol(name);
}
}
PushScope(Scope::Kind::BlockData, &MakeSymbol(name, SubprogramDetails{}));
if (name.source.empty()) {
// Don't let unnamed BLOCK DATA conflict with unnamed PROGRAM
PushScope(Scope::Kind::BlockData, nullptr);
} else {
PushScope(Scope::Kind::BlockData, &MakeSymbol(name, SubprogramDetails{}));
}
}
// If name is a generic, return specific subprogram with the same name.