mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 14:45:29 +00:00
Try to avoid crashing in HTML5 parser cycle collection
This commit is contained in:
parent
d88f6b6525
commit
b01c3bdb49
@ -556,13 +556,16 @@ nsHtml5TreeBuilder::DoTraverse(nsCycleCollectionTraversalCallback &cb)
|
|||||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(formPointer);
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(formPointer);
|
||||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(headPointer);
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(headPointer);
|
||||||
|
|
||||||
|
if (stack) {
|
||||||
for (PRInt32 i = 0; i <= currentPtr; i++) {
|
for (PRInt32 i = 0; i <= currentPtr; i++) {
|
||||||
#ifdef DEBUG_CC
|
#ifdef DEBUG_CC
|
||||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "stack[i]");
|
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "stack[i]");
|
||||||
#endif
|
#endif
|
||||||
cb.NoteNativeChild(stack[i], &NS_CYCLE_COLLECTION_NAME(nsHtml5StackNode));
|
cb.NoteNativeChild(stack[i], &NS_CYCLE_COLLECTION_NAME(nsHtml5StackNode));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (listOfActiveFormattingElements) {
|
||||||
for (PRInt32 i = 0; i <= listPtr; i++) {
|
for (PRInt32 i = 0; i <= listPtr; i++) {
|
||||||
if (listOfActiveFormattingElements[i]) {
|
if (listOfActiveFormattingElements[i]) {
|
||||||
#ifdef DEBUG_CC
|
#ifdef DEBUG_CC
|
||||||
@ -571,6 +574,7 @@ nsHtml5TreeBuilder::DoTraverse(nsCycleCollectionTraversalCallback &cb)
|
|||||||
cb.NoteNativeChild(listOfActiveFormattingElements[i], &NS_CYCLE_COLLECTION_NAME(nsHtml5StackNode));
|
cb.NoteNativeChild(listOfActiveFormattingElements[i], &NS_CYCLE_COLLECTION_NAME(nsHtml5StackNode));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const nsHtml5TreeOperation* start = mOpQueue.Elements();
|
const nsHtml5TreeOperation* start = mOpQueue.Elements();
|
||||||
const nsHtml5TreeOperation* end = start + mOpQueue.Length();
|
const nsHtml5TreeOperation* end = start + mOpQueue.Length();
|
||||||
|
Loading…
Reference in New Issue
Block a user