mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 20:01:50 +00:00
fixes bug 324981 "nsTArray crash in RemoveElement" r=bsmedberg
This commit is contained in:
parent
45f4011af8
commit
c7c435dffa
@ -473,7 +473,7 @@ class nsTArray : public nsTArray_base {
|
||||
template<class Item, class Comparator>
|
||||
void RemoveElement(const Item& item, const Comparator& comp) {
|
||||
index_type i = IndexOf(item, 0, comp);
|
||||
if (i >= 0)
|
||||
if (i != NoIndex)
|
||||
RemoveElementAt(i);
|
||||
}
|
||||
|
||||
|
@ -121,6 +121,10 @@ static PRBool test_basic_array(ElementType *data,
|
||||
ary.AppendElements(nsnull, 0);
|
||||
ary.AppendElements(empty);
|
||||
|
||||
// See bug 324981
|
||||
ary.RemoveElement(extra);
|
||||
ary.RemoveElement(extra);
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user