summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/xfa_fmparse.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-04-17 11:30:25 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-18 13:22:37 +0000
commit0f9b0a9d72a46cf708866aebc5f1103087b3d2c2 (patch)
treeaa6d9bb1cac9851f2a2cb6b144c20ab2e7fd3da3 /xfa/fxfa/fm2js/xfa_fmparse.cpp
parentcec01808e8b155f598b2a9ea527736ce774e76a2 (diff)
downloadpdfium-0f9b0a9d72a46cf708866aebc5f1103087b3d2c2.tar.xz
Require unique_ptr arg for CXFA_FMLexer::SetToken()
Change-Id: Id252b3b2208ac9f792220605ddc1eb3ba29e2d55 Reviewed-on: https://pdfium-review.googlesource.com/4260 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/fm2js/xfa_fmparse.cpp')
-rw-r--r--xfa/fxfa/fm2js/xfa_fmparse.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/xfa/fxfa/fm2js/xfa_fmparse.cpp b/xfa/fxfa/fm2js/xfa_fmparse.cpp
index c1f609315b..298a2eb334 100644
--- a/xfa/fxfa/fm2js/xfa_fmparse.cpp
+++ b/xfa/fxfa/fm2js/xfa_fmparse.cpp
@@ -857,10 +857,11 @@ std::unique_ptr<CXFA_FMExpression> CXFA_FMParse::ParseIfExpression() {
Check(TOKrparen);
if (m_pToken->m_type != TOKthen) {
m_lexer->SetCurrentLine(line);
- m_pToken = new CXFA_FMToken(line);
+ auto pNewToken = pdfium::MakeUnique<CXFA_FMToken>(line);
+ m_pToken = pNewToken.get();
m_pToken->m_type = TOKidentifier;
m_pToken->m_wstring = L"if";
- m_lexer->SetToken(m_pToken);
+ m_lexer->SetToken(std::move(pNewToken));
m_lexer->RestorePos(pStartPos);
return ParseExpExpression();
}