Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
QilDepthChecker.cs
Go to the documentation of this file.
1
using
System.Collections.Generic
;
2
3
namespace
System.Xml.Xsl.Qil
;
4
5
internal
sealed
class
QilDepthChecker
6
{
7
private
readonly
Dictionary<QilNode, bool>
_visitedRef
=
new
Dictionary<QilNode, bool>
();
8
9
public
static
void
Check
(
QilNode
input
)
10
{
11
if
(
System
.
LocalAppContextSwitches
.
LimitXPathComplexity
)
12
{
13
new
QilDepthChecker
().
Check
(
input
, 0);
14
}
15
}
16
17
private
void
Check
(
QilNode
input
,
int
depth)
18
{
19
if
(depth > 800)
20
{
21
throw
XsltException
.
Create
(
System
.
SR
.
Xslt_InputTooComplex
);
22
}
23
if
(
input
is
QilReference
)
24
{
25
if
(
_visitedRef
.
ContainsKey
(
input
))
26
{
27
return
;
28
}
29
_visitedRef
[
input
] =
true
;
30
}
31
int
depth2
= depth + 1;
32
for
(
int
i = 0; i <
input
.Count; i++)
33
{
34
QilNode
qilNode
=
input
[i];
35
if
(
qilNode
!=
null
)
36
{
37
Check
(
qilNode
,
depth2
);
38
}
39
}
40
}
41
}
System.Collections.Generic.Dictionary.ContainsKey
bool ContainsKey(TKey key)
Definition
Dictionary.cs:917
System.Collections.Generic.Dictionary
Definition
Dictionary.cs:14
System.LocalAppContextSwitches.LimitXPathComplexity
static bool LimitXPathComplexity
Definition
LocalAppContextSwitches.cs:45
System.LocalAppContextSwitches
Definition
LocalAppContextSwitches.cs:6
System.SR.Xslt_InputTooComplex
static string Xslt_InputTooComplex
Definition
SR.cs:1862
System.SR
Definition
SR.cs:7
System.Xml.Xsl.Qil.QilDepthChecker.Check
static void Check(QilNode input)
Definition
QilDepthChecker.cs:9
System.Xml.Xsl.Qil.QilDepthChecker.Check
void Check(QilNode input, int depth)
Definition
QilDepthChecker.cs:17
System.Xml.Xsl.Qil.QilDepthChecker._visitedRef
readonly Dictionary< QilNode, bool > _visitedRef
Definition
QilDepthChecker.cs:7
System.Xml.Xsl.Qil.QilDepthChecker
Definition
QilDepthChecker.cs:6
System.Xml.Xsl.Qil.QilNode
Definition
QilNode.cs:7
System.Xml.Xsl.Qil.QilReference
Definition
QilReference.cs:6
System.Xml.Xsl.XsltException.Create
static XsltException Create(string res, params string[] args)
Definition
XsltException.cs:87
System.Xml.Xsl.XsltException
Definition
XsltException.cs:12
System.Collections.Generic
Definition
IHashKeyCollection.cs:1
System.Xml.Xsl.Qil
Definition
IQilAnnotation.cs:1
System.Xml.ValueHandleType.Dictionary
@ Dictionary
System.ExceptionArgument.input
@ input
System
Definition
BlockingCollection.cs:8
source
System.Private.Xml
System.Xml.Xsl.Qil
QilDepthChecker.cs
Generated by
1.10.0