mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 21:00:50 +00:00

a common subroutine, but only replace might need to dereference the regexp created from a non-regexp-type argument, which is converted to string and compiled into a regexp data struct unowned by any rooted object. This case was broken: a dangling GlobData.regexp pointer could be dereferenced in the "lambda replace" code under str_replace, in find_replen, *after* the call to match_or_replace had destroyed the regexp and returned to str_replace. Bug 167658 reported the symptoms. - Consolidate GlobData members into a flags word, avoiding yet another ad hoc paramter to m_or_r (forceFlat). - Use a local root in str_match to avoid adding and removing a global root.