mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 06:35:42 +00:00
Try to avoid crashing in HTML5 parser cycle collection
This commit is contained in:
parent
d88f6b6525
commit
b01c3bdb49
@ -556,19 +556,23 @@ nsHtml5TreeBuilder::DoTraverse(nsCycleCollectionTraversalCallback &cb)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(formPointer);
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(headPointer);
|
||||
|
||||
for (PRInt32 i = 0; i <= currentPtr; i++) {
|
||||
if (stack) {
|
||||
for (PRInt32 i = 0; i <= currentPtr; i++) {
|
||||
#ifdef DEBUG_CC
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "stack[i]");
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "stack[i]");
|
||||
#endif
|
||||
cb.NoteNativeChild(stack[i], &NS_CYCLE_COLLECTION_NAME(nsHtml5StackNode));
|
||||
cb.NoteNativeChild(stack[i], &NS_CYCLE_COLLECTION_NAME(nsHtml5StackNode));
|
||||
}
|
||||
}
|
||||
|
||||
for (PRInt32 i = 0; i <= listPtr; i++) {
|
||||
if (listOfActiveFormattingElements[i]) {
|
||||
if (listOfActiveFormattingElements) {
|
||||
for (PRInt32 i = 0; i <= listPtr; i++) {
|
||||
if (listOfActiveFormattingElements[i]) {
|
||||
#ifdef DEBUG_CC
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "listOfActiveFormattingElements[i]");
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "listOfActiveFormattingElements[i]");
|
||||
#endif
|
||||
cb.NoteNativeChild(listOfActiveFormattingElements[i], &NS_CYCLE_COLLECTION_NAME(nsHtml5StackNode));
|
||||
cb.NoteNativeChild(listOfActiveFormattingElements[i], &NS_CYCLE_COLLECTION_NAME(nsHtml5StackNode));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user