Skip to content

Commit

Permalink
Drop down the recursion limit on SanityCheckParentPointers.
Browse files Browse the repository at this point in the history
This caused an unexplained sigsegv in SanityCheckParentPointers on a
test file that parses into a DOM tree 27,500 nodes deep, and dropping
the recursion limit seems to fix it in all clients.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=58939249
  • Loading branch information
Jonathan Tang committed Feb 18, 2014
1 parent 8f95ebd commit 59b1b5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void SanityCheckPointers(const char* input, size_t input_length,
// depth here to avoid blowing the stack. Alternatively, we could externalize
// the stack and use an iterative algorithm, but that gets us very little for
// the additional programming complexity.
if (node->type == GUMBO_NODE_DOCUMENT || depth > 500) {
if (node->type == GUMBO_NODE_DOCUMENT || depth > 400) {
// Don't sanity-check the document as well...we start with the root.
return;
}
Expand Down

0 comments on commit 59b1b5e

Please sign in to comment.