Fix crash/hang in Parser::newClosureName
The parser was updating a static std::map without a lock. It looks like this is supposed to be local to a file anyway, so add the map as a member of ParserBase.
Esse commit está contido em:
@@ -53,8 +53,7 @@ std::string ParserBase::newClosureName(
|
||||
}
|
||||
name += funcName;
|
||||
|
||||
static std::map<std::string, int> 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);
|
||||
|
||||
@@ -199,6 +199,7 @@ protected:
|
||||
bool m_nsFileScope;
|
||||
std::string m_namespace; // current namespace
|
||||
hphp_string_imap<std::string> m_aliases;
|
||||
hphp_string_imap<int> m_seenClosures;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário