tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 01f73409def9ab615e1624b8aa2f8eb400400a06
parent 60b135e6e3b6e53303b43afe54a2fc4c0fd105dc
Author: Emilio Cobos Álvarez <emilio@crisal.io>
Date:   Mon, 22 Dec 2025 23:28:21 +0100

Bug 2006613 - Fix some ASAN issues.

Gotta love C++. See bug 2007450 for the underlying issue.

ClearForm(false) is harmless so no need to reverse.

Diffstat:
Mdom/html/HTMLFormElement.cpp | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/dom/html/HTMLFormElement.cpp b/dom/html/HTMLFormElement.cpp @@ -1619,7 +1619,9 @@ bool HTMLFormElement::IsLastActiveElement( const nsGenericHTMLFormElement* aElement) const { MOZ_ASSERT(aElement, "Unexpected call"); - for (auto* element : Reversed(mControls->mElements.AsSpan())) { + // See bug 2007450 for why this temporary is needed. + Span elements = mControls->mElements.AsSpan(); + for (auto* element : Reversed(elements)) { const auto* fc = nsIFormControl::FromNode(element); MOZ_ASSERT(fc); // XXX How about date/time control? @@ -1744,7 +1746,7 @@ int32_t HTMLFormElement::IndexOfContent(nsIContent* aContent) { } void HTMLFormElement::Clear() { - for (HTMLImageElement* image : Reversed(mImageElements.AsSpan())) { + for (HTMLImageElement* image : mImageElements.AsSpan()) { image->ClearForm(false); } mImageElements.Clear();