+2005-01-21 David Hyatt <hyatt@apple.com>
+
+ Fix for 3966349, hang loading page. Make sure that loops using popOneBlock properly check for a null
+ blockStack to avoid an infinite loop.
+
+ Reviewed by kocienda
+
+ * khtml/html/htmlparser.cpp:
+ (KHTMLParser::parseToken):
+ (KHTMLParser::insertNode):
+ (KHTMLParser::popInlineBlocks):
+
2005-01-21 Ken Kocienda <kocienda@apple.com>
Reviewed by John
// if this tag is forbidden inside the current context, pop
// blocks until we are allowed to add it...
- while (t->id <= ID_LAST_TAG && forbiddenTag[t->id]) {
+ while (blockStack && t->id <= ID_LAST_TAG && forbiddenTag[t->id]) {
#ifdef PARSER_DEBUG
kdDebug( 6035 ) << "t->id: " << t->id << " is forbidden :-( " << endl;
#endif
case ID_TD:
if (inStrayTableContent && !isTableRelatedTag(current->id())) {
// pop out to the nearest enclosing table-related tag.
- while (!isTableRelatedTag(current->id()))
+ while (blockStack && !isTableRelatedTag(current->id()))
popOneBlock();
return insertNode(n);
}
case ID_TFOOT:
case ID_COLGROUP: {
if (isTableRelatedTag(current->id())) {
- while (current->id() != ID_TABLE && isTableRelatedTag(current->id()))
+ while (blockStack && current->id() != ID_TABLE && isTableRelatedTag(current->id()))
popOneBlock();
return insertNode(n);
}
void KHTMLParser::popInlineBlocks()
{
- while(current->isInline())
+ while (blockStack && current->isInline())
popOneBlock();
}