summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp')
-rw-r--r--xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp b/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp
index 5ee27b189e..1eedebfcca 100644
--- a/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp
@@ -238,3 +238,22 @@ TEST(CXFA_FMParserTest, ParseBadElseIfExpression) {
ASSERT_TRUE(ast == nullptr);
EXPECT_TRUE(parser->HasError());
}
+
+TEST(CXFA_FMParserTest, ParseDepthWithWideTree) {
+ const wchar_t input[] = {L"a <> b <> c <> d <> e <> f <> g <> h <> i <> j"};
+
+ {
+ auto parser = pdfium::MakeUnique<CXFA_FMParser>(input);
+ std::unique_ptr<CXFA_FMAST> ast = parser->Parse();
+ ASSERT_TRUE(ast);
+ EXPECT_TRUE(!parser->HasError());
+ }
+
+ {
+ auto parser = pdfium::MakeUnique<CXFA_FMParser>(input);
+ parser->SetMaxParseDepthForTest(5);
+ std::unique_ptr<CXFA_FMAST> ast = parser->Parse();
+ ASSERT_TRUE(ast == nullptr);
+ EXPECT_TRUE(parser->HasError());
+ }
+}