mirror of
https://github.com/zeux/pugixml.git
synced 2025-01-13 17:37:58 +08:00
Fix stack overflow in tests on MSVC x64
The default stack on MSVC/x64/debug is sufficient for 1692 nested invocations only, whereas on clang/linux it's ~8K... For now set the limit to be conservative.
This commit is contained in:
parent
c7090e6c33
commit
20aef1cd4b
@ -40,6 +40,9 @@
|
||||
// #define PUGIXML_MEMORY_OUTPUT_STACK 10240
|
||||
// #define PUGIXML_MEMORY_XPATH_PAGE_SIZE 4096
|
||||
|
||||
// Tune this constant to adjust max nesting for XPath queries
|
||||
// #define PUGIXML_XPATH_DEPTH_LIMIT 1024
|
||||
|
||||
// Uncomment this to switch to header-only version
|
||||
// #define PUGIXML_HEADER_ONLY
|
||||
|
||||
|
@ -11147,7 +11147,7 @@ PUGI__NS_BEGIN
|
||||
#ifdef PUGIXML_XPATH_DEPTH_LIMIT
|
||||
PUGIXML_XPATH_DEPTH_LIMIT
|
||||
#else
|
||||
4096
|
||||
1024
|
||||
#endif
|
||||
;
|
||||
|
||||
|
@ -394,7 +394,7 @@ static std::basic_string<char_t> rep(const std::basic_string<char_t>& base, size
|
||||
|
||||
TEST(xpath_parse_depth_limit)
|
||||
{
|
||||
const size_t limit = 5000;
|
||||
const size_t limit = 1500;
|
||||
|
||||
CHECK_XPATH_FAIL((rep(STR("("), limit) + STR("1") + rep(STR(")"), limit)).c_str());
|
||||
CHECK_XPATH_FAIL((STR("(id('a'))") + rep(STR("[1]"), limit)).c_str());
|
||||
|
Loading…
x
Reference in New Issue
Block a user