summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.cpp
blob: 6312ba6b3d30e61d101e1ed65addf292b35ff374 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright 2017 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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;
}