summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/cxfa_fmparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/fm2js/cxfa_fmparser.cpp')
-rw-r--r--xfa/fxfa/fm2js/cxfa_fmparser.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmparser.cpp b/xfa/fxfa/fm2js/cxfa_fmparser.cpp
index f000066a19..20e0fa6d1c 100644
--- a/xfa/fxfa/fm2js/cxfa_fmparser.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmparser.cpp
@@ -911,6 +911,8 @@ std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseIfExpression() {
return nullptr;
std::unique_ptr<CXFA_FMSimpleExpression> pCondition = ParseParenExpression();
+ if (!pCondition)
+ return nullptr;
if (!CheckThenNext(TOKthen))
return nullptr;
@@ -923,6 +925,8 @@ std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseIfExpression() {
return nullptr;
auto elseIfCondition = ParseParenExpression();
+ if (!elseIfCondition)
+ return nullptr;
if (!CheckThenNext(TOKthen))
return nullptr;
@@ -969,6 +973,7 @@ std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseWhileExpression() {
std::move(pCondition),
pdfium::MakeUnique<CXFA_FMBlockExpression>(std::move(exprs)));
}
+
// For := 'for' Assignment 'upto' Accessor ('step' SimpleExpression)?
// 'do' ExpressionList 'endfor' |
// 'for' Assignment 'downto' Accessor ('step' SimpleExpression)?