Backed out changeset 9f39547cfab3 (bug 850534) for yarr crashes on a CLOSED TREE

This commit is contained in:
Hannes Verschore 2013-03-14 23:15:50 +01:00
Родитель 71bffecd0f
Коммит d510031808
4 изменённых файлов: 8 добавлений и 24 удалений

Просмотреть файл

@ -1734,7 +1734,6 @@ public:
unsigned numSubpatterns = lastSubpatternId - subpatternId + 1;
ByteDisjunction* parenthesesDisjunction = js_new<ByteDisjunction>(numSubpatterns, callFrameSize);
parenthesesDisjunction->terms.reserve(endTerm - beginTerm + 1);
parenthesesDisjunction->terms.append(ByteTerm::SubpatternBegin());
for (unsigned termInParentheses = beginTerm + 1; termInParentheses < endTerm; ++termInParentheses)
parenthesesDisjunction->terms.append(m_bodyDisjunction->terms[termInParentheses]);

Просмотреть файл

@ -341,7 +341,7 @@ public:
struct BytecodePattern {
WTF_MAKE_FAST_ALLOCATED;
public:
BytecodePattern(PassOwnPtr<ByteDisjunction> body, Vector<ByteDisjunction*> &allParenthesesInfo, YarrPattern& pattern, BumpPointerAllocator* allocator)
BytecodePattern(PassOwnPtr<ByteDisjunction> body, const Vector<ByteDisjunction*> &allParenthesesInfo, YarrPattern& pattern, BumpPointerAllocator* allocator)
: m_body(body)
, m_ignoreCase(pattern.m_ignoreCase)
, m_multiline(pattern.m_multiline)
@ -350,17 +350,12 @@ public:
newlineCharacterClass = pattern.newlineCharacterClass();
wordcharCharacterClass = pattern.wordcharCharacterClass();
// Trick: 'Steal' the YarrPattern's ParenthesesInfo!
// The input vector isn't used afterwards anymore,
// that way we don't have to copy the input.
JS_ASSERT(m_allParenthesesInfo.size() == 0);
m_allParenthesesInfo.swap(allParenthesesInfo);
// Trick: 'Steal' the YarrPattern's CharacterClasses!
// The input vector isn't used afterwards anymore,
// that way we don't have to copy the input.
JS_ASSERT(m_userCharacterClasses.size() == 0);
m_userCharacterClasses.swap(pattern.m_userCharacterClasses);
m_allParenthesesInfo.append(allParenthesesInfo);
m_userCharacterClasses.append(pattern.m_userCharacterClasses);
// 'Steal' the YarrPattern's CharacterClasses! We clear its
// array, so that it won't delete them on destruction. We'll
// take responsibility for that.
pattern.m_userCharacterClasses.clear();
}
~BytecodePattern()

Просмотреть файл

@ -491,7 +491,6 @@ public:
newDisjunction->m_parent = disjunction->m_parent;
}
PatternAlternative* newAlternative = newDisjunction->addNewAlternative();
newAlternative->m_terms.reserve(alternative->m_terms.size());
for (unsigned i = 0; i < alternative->m_terms.size(); ++i)
newAlternative->m_terms.append(copyTerm(alternative->m_terms[i], filterStartsWithBOL));
}

Просмотреть файл

@ -204,10 +204,6 @@ class Vector {
for (T *p = impl.begin(); p != impl.end(); ++p)
js_delete(*p);
}
bool reserve(size_t capacity) {
return impl.reserve(capacity);
}
};
template<typename T>
@ -235,11 +231,6 @@ class Vector<OwnPtr<T> > {
delete_(*p);
return impl.clear();
}
void reserve(size_t capacity) {
// XXX yarr-oom
(void) impl.reserve(capacity);
}
};
template <typename T, size_t N>