summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/fm2js')
-rw-r--r--xfa/fxfa/fm2js/cxfa_fmlexer.cpp2
-rw-r--r--xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.cpp10
-rw-r--r--xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.h8
3 files changed, 7 insertions, 13 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmlexer.cpp b/xfa/fxfa/fm2js/cxfa_fmlexer.cpp
index 41989f0a2d..3559fb7aeb 100644
--- a/xfa/fxfa/fm2js/cxfa_fmlexer.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmlexer.cpp
@@ -78,7 +78,7 @@ const XFA_FMKeyword keyWords[] = {
};
#ifndef NDEBUG
-const wchar_t* tokenStrings[] = {
+const wchar_t* const tokenStrings[] = {
L"TOKand", L"TOKlparen", L"TOKrparen", L"TOKmul",
L"TOKplus", L"TOKcomma", L"TOKminus", L"TOKdot",
L"TOKdiv", L"TOKlt", L"TOKassign", L"TOKgt",
diff --git a/xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.cpp b/xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.cpp
index 6312ba6b3d..023516bb6e 100644
--- a/xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.cpp
@@ -4,17 +4,7 @@
#include "xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.h"
-namespace {
-
-// Arbitarily picked by looking at how deep a translation got before hitting
-// the getting fuzzer memory limits. Should be larger then |kMaxParseDepth| in
-// cxfa_fmparser.cpp.
-const unsigned int kMaxDepth = 5000;
-
-} // namespace
-
unsigned long CXFA_FMToJavaScriptDepth::depth_ = 0;
-unsigned long CXFA_FMToJavaScriptDepth::max_depth_ = kMaxDepth;
void CXFA_FMToJavaScriptDepth::Reset() {
depth_ = 0;
diff --git a/xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.h b/xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.h
index 14f87a68f5..f4cd1be472 100644
--- a/xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.h
+++ b/xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.h
@@ -10,13 +10,17 @@ class CXFA_FMToJavaScriptDepth {
CXFA_FMToJavaScriptDepth() { depth_++; }
~CXFA_FMToJavaScriptDepth() { depth_--; }
- bool IsWithinMaxDepth() const { return depth_ <= max_depth_; }
+ bool IsWithinMaxDepth() const { return depth_ <= kMaxDepth; }
static void Reset();
private:
+ // Arbitarily picked by looking at how deep a translation got before hitting
+ // the getting fuzzer memory limits. Should be larger then |kMaxParseDepth| in
+ // cxfa_fmparser.cpp.
+ const unsigned long kMaxDepth = 5000;
+
static unsigned long depth_;
- static unsigned long max_depth_;
};
#endif // XFA_FXFA_FM2JS_CXFA_FMTOJAVASCRIPTDEPTH_H_