diff --git a/hphp/util/parser/parser.cpp b/hphp/util/parser/parser.cpp index a2f864673..f679c63d3 100644 --- a/hphp/util/parser/parser.cpp +++ b/hphp/util/parser/parser.cpp @@ -53,8 +53,7 @@ std::string ParserBase::newClosureName( } name += funcName; - static std::map s_seenClosures; - int id = ++s_seenClosures[name]; + int id = ++m_seenClosures[name]; if (id > 1) { // we've seen the same name before, uniquify name = name + '#' + std::to_string(id); diff --git a/hphp/util/parser/parser.h b/hphp/util/parser/parser.h index 892fdafea..de5a1480e 100644 --- a/hphp/util/parser/parser.h +++ b/hphp/util/parser/parser.h @@ -199,6 +199,7 @@ protected: bool m_nsFileScope; std::string m_namespace; // current namespace hphp_string_imap m_aliases; + hphp_string_imap m_seenClosures; }; ///////////////////////////////////////////////////////////////////////////////