summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/cxfa_fmlexer.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-05-08 15:20:27 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-08 15:20:27 +0000
commitdec08c8d3fbc4e89748f2d655b32727cfab373ed (patch)
tree9aac943ee5b8471322be5747d02ed8927a5ffa05 /xfa/fxfa/fm2js/cxfa_fmlexer.h
parentbda113c645673fd152bb9ca3eaddd3c34920223e (diff)
downloadpdfium-dec08c8d3fbc4e89748f2d655b32727cfab373ed.tar.xz
[fm2js] Fail transpiling if lexer has left over data
If there is remaining data after the lexer has said it's complete then something has gone wrong while lexing the formcalc data. This CL changes the transpiler to return an error in the case of the lexer havign extra data. Bug: chromium:834575 Change-Id: I8a1288a7f01cc69faf2033829d68246d815258de Reviewed-on: https://pdfium-review.googlesource.com/32130 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'xfa/fxfa/fm2js/cxfa_fmlexer.h')
-rw-r--r--xfa/fxfa/fm2js/cxfa_fmlexer.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmlexer.h b/xfa/fxfa/fm2js/cxfa_fmlexer.h
index 3864abb0eb..58b193e0ec 100644
--- a/xfa/fxfa/fm2js/cxfa_fmlexer.h
+++ b/xfa/fxfa/fm2js/cxfa_fmlexer.h
@@ -109,6 +109,7 @@ class CXFA_FMLexer {
~CXFA_FMLexer();
CXFA_FMToken NextToken();
+ bool IsComplete() const { return m_cursor >= m_end; }
private:
CXFA_FMToken AdvanceForNumber();