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.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmparser.cpp b/xfa/fxfa/fm2js/cxfa_fmparser.cpp
index a103183c38..fc8c58511a 100644
--- a/xfa/fxfa/fm2js/cxfa_fmparser.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmparser.cpp
@@ -938,8 +938,6 @@ std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseIfExpression() {
AutoRestorer<unsigned long> restorer(&m_parse_depth);
if (HasError() || !IncrementParseDepthAndCheck())
return nullptr;
-
- const wchar_t* pStartPos = m_lexer->GetPos();
if (!NextToken() || !CheckThenNext(TOKlparen))
return nullptr;
@@ -955,13 +953,12 @@ std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseIfExpression() {
}
if (!CheckThenNext(TOKrparen))
return nullptr;
+
if (m_token.m_type != TOKthen) {
- m_token = CXFA_FMToken(TOKidentifier);
- m_token.m_string = L"if";
- m_lexer->SetPos(pStartPos);
- return ParseExpExpression();
+ m_error = true;
+ return nullptr;
}
- if (!CheckThenNext(TOKthen))
+ if (!NextToken())
return nullptr;
std::unique_ptr<CXFA_FMExpression> pIfExpression = ParseBlockExpression();