summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-03-06 13:51:18 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-06 13:51:18 +0000
commit9600a771999de20fb22130cdb97088591508f89f (patch)
treebaba13c11b97db3c92f53b37fbc4c5c0c4554371
parentf3be555096b0b64917d27578e51c9e6c7d9c7083 (diff)
downloadpdfium-9600a771999de20fb22130cdb97088591508f89f.tar.xz
[formcalc] Allow empty declaration bodies
This CL removes the checks for empty declaration bodies. Change-Id: I06a8f602f49d7709bce86442cae2d38991fa5d82 Reviewed-on: https://pdfium-review.googlesource.com/27950 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
-rw-r--r--xfa/fxfa/fm2js/cxfa_fmparser.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmparser.cpp b/xfa/fxfa/fm2js/cxfa_fmparser.cpp
index 09cbee5a10..f000066a19 100644
--- a/xfa/fxfa/fm2js/cxfa_fmparser.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmparser.cpp
@@ -131,11 +131,8 @@ std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseFunction() {
return nullptr;
std::vector<std::unique_ptr<CXFA_FMExpression>> expressions;
- if (m_token.m_type != TOKendfunc) {
+ if (m_token.m_type != TOKendfunc)
expressions = ParseExpressionList();
- if (expressions.empty())
- return nullptr;
- }
if (!CheckThenNext(TOKendfunc))
return nullptr;
@@ -965,7 +962,7 @@ std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseWhileExpression() {
return nullptr;
auto exprs = ParseExpressionList();
- if (exprs.empty() || !CheckThenNext(TOKendwhile))
+ if (!CheckThenNext(TOKendwhile))
return nullptr;
return pdfium::MakeUnique<CXFA_FMWhileExpression>(
@@ -1023,7 +1020,7 @@ std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseForExpression() {
return nullptr;
auto exprs = ParseExpressionList();
- if (exprs.empty() || !CheckThenNext(TOKendfor))
+ if (!CheckThenNext(TOKendfor))
return nullptr;
return pdfium::MakeUnique<CXFA_FMForExpression>(
@@ -1069,7 +1066,7 @@ std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseForeachExpression() {
return nullptr;
auto exprs = ParseExpressionList();
- if (exprs.empty() || !CheckThenNext(TOKendfor))
+ if (!CheckThenNext(TOKendfor))
return nullptr;
return pdfium::MakeUnique<CXFA_FMForeachExpression>(
@@ -1089,7 +1086,7 @@ std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseDoExpression() {
return nullptr;
auto exprs = ParseExpressionList();
- if (exprs.empty() || !CheckThenNext(TOKend))
+ if (!CheckThenNext(TOKend))
return nullptr;
return pdfium::MakeUnique<CXFA_FMDoExpression>(