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_OUTPUT_STACK 10240
|
||||||
// #define PUGIXML_MEMORY_XPATH_PAGE_SIZE 4096
|
// #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
|
// Uncomment this to switch to header-only version
|
||||||
// #define PUGIXML_HEADER_ONLY
|
// #define PUGIXML_HEADER_ONLY
|
||||||
|
|
||||||
|
|||||||
@ -11147,7 +11147,7 @@ PUGI__NS_BEGIN
|
|||||||
#ifdef PUGIXML_XPATH_DEPTH_LIMIT
|
#ifdef PUGIXML_XPATH_DEPTH_LIMIT
|
||||||
PUGIXML_XPATH_DEPTH_LIMIT
|
PUGIXML_XPATH_DEPTH_LIMIT
|
||||||
#else
|
#else
|
||||||
4096
|
1024
|
||||||
#endif
|
#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)
|
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((rep(STR("("), limit) + STR("1") + rep(STR(")"), limit)).c_str());
|
||||||
CHECK_XPATH_FAIL((STR("(id('a'))") + rep(STR("[1]"), limit)).c_str());
|
CHECK_XPATH_FAIL((STR("(id('a'))") + rep(STR("[1]"), limit)).c_str());
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user