diff options
-rw-r--r-- | lld/include/lld/Driver/WinLinkInputGraph.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lld/include/lld/Driver/WinLinkInputGraph.h b/lld/include/lld/Driver/WinLinkInputGraph.h index 9c798007124..4d5e4339037 100644 --- a/lld/include/lld/Driver/WinLinkInputGraph.h +++ b/lld/include/lld/Driver/WinLinkInputGraph.h @@ -66,10 +66,14 @@ public: /// \brief Parse the group members. error_code parse(const LinkingContext &ctx, raw_ostream &diagnostics) override { + auto *pctx = (PECOFFLinkingContext *)(&ctx); + error_code ec = error_code::success(); + pctx->lock(); for (auto &elem : _elements) - if (error_code ec = elem->parse(ctx, diagnostics)) - return ec; - return error_code::success(); + if ((ec = elem->parse(ctx, diagnostics))) + break; + pctx->unlock(); + return ec; } }; |