[flang] Fix bug with popping scopes.
authorTim Keith <tkeith@nvidia.com>
Wed, 24 Oct 2018 00:05:12 +0000 (17:05 -0700)
committerTim Keith <tkeith@nvidia.com>
Fri, 26 Oct 2018 14:16:00 +0000 (07:16 -0700)
commitac0c59992051bae128bd46df06a63bd74cdcaa8b
treee50d5fc3c40e021a7a9e7001874609b73dfb51d7
parent4687189913cddd1f826170719434d0fe403b9bc2
[flang] Fix bug with popping scopes.

Processing a SUBMODULE can cause any number of scopes to be pushed on
the scope stack. We don't know how many to pop at the end, so add
`ClearScopes()` to reset the scope stack to its original state.

Original-commit: flang-compiler/f18@0be4cebd66b81281bfa07016eb2b1393cf271e69
Reviewed-on: https://github.com/flang-compiler/f18/pull/218
Tree-same-pre-rewrite: false
flang/lib/semantics/resolve-names.cc