#if !FEATURE_NETCORE
[NonSerialized()]
#endif
- public static readonly TimeSpan InfiniteMatchTimeout = Timeout.InfiniteTimeSpan;
+ public static readonly TimeSpan InfiniteMatchTimeout =
+#if BOOTSTRAP_BASIC
+ new TimeSpan (0, 0, 0, 0, Timeout.Infinite);
+#else
+ Timeout.InfiniteTimeSpan;
+#endif
#else
internal static readonly TimeSpan InfiniteMatchTimeout = new TimeSpan(0, 0, 0, 0, Timeout.Infinite);
#endif
* This method is internal virtual so the jit does not inline it.
*/
[
+#if !DISABLE_CAS_USE
HostProtection(MayLeakOnAbort=true),
+#endif
MethodImplAttribute(MethodImplOptions.NoInlining)
]
internal RegexRunnerFactory Compile(RegexCode code, RegexOptions roptions) {
#if !SILVERLIGHT
/// <devdoc>
/// </devdoc>
+#if !DISABLE_CAS_USE
[HostProtection(MayLeakOnAbort=true)]
+#endif
[ResourceExposure(ResourceScope.Machine)] // The AssemblyName is interesting.
[ResourceConsumption(ResourceScope.Machine)]
[SuppressMessage("Microsoft.Naming","CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId="assemblyname", Justification="[....]: already shipped since v1 - can't fix without causing a breaking change")]
/// <devdoc>
/// </devdoc>
+#if !DISABLE_CAS_USE
[HostProtection(MayLeakOnAbort=true)]
+#endif
[ResourceExposure(ResourceScope.Machine)] // The AssemblyName is interesting.
[ResourceConsumption(ResourceScope.Machine)]
[SuppressMessage("Microsoft.Naming","CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId="assemblyname", Justification="[....]: already shipped since v1 - can't fix without causing a breaking change")]
CompileToAssemblyInternal(regexinfos, assemblyname, attributes, null);
}
+#if !DISABLE_CAS_USE
[HostProtection(MayLeakOnAbort=true)]
+#endif
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
[SuppressMessage("Microsoft.Naming","CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId="assemblyname", Justification="[....]: already shipped since v1 - can't fix without causing a breaking change")]
static RegexCompiler() {
// <SECREVIEW> Regex only generates string manipulation, so this is ok.
// </SECREVIEW>
-
+
+#if !DISABLE_CAS_USE
new ReflectionPermission(PermissionState.Unrestricted).Assert();
+#endif
try {
// note some fields
_textbegF = RegexRunnerField("runtextbeg");
// <SECREVIEW> Regex only generates string manipulation, so this is ok.
// </SECREVIEW>
+#if !DISABLE_CAS_USE
new ReflectionPermission(PermissionState.Unrestricted).Assert();
+#endif
try {
factory = c.FactoryInstanceFromCode(code, options);
}
Type factory;
+#if !DISABLE_CAS_USE
new ReflectionPermission(PermissionState.Unrestricted).Assert();
+#endif
try {
factory = c.FactoryTypeFromCode(code, options, fullname);
c.GenerateRegexType(pattern, options, fullname, regexes[i].IsPublic, code, tree, factory, mTimeout);
* grouping stack when they get too full.
*/
internal void GenerateMiddleSection() {
+#pragma warning disable 219
Label l1 = DefineLabel();
+#pragma warning restore 219
Label[] table;
int i;
Label lAdvance = DefineLabel();
Label lFail = DefineLabel();
Label lStart = DefineLabel();
+#pragma warning disable 219
Label lOutOfRange = DefineLabel();
+#pragma warning restore 219
Label lPartialMatch = DefineLabel();
}
else {
LocalBuilder cV = _temp2V;
+#pragma warning disable 219
LocalBuilder chV = _tempV;
+#pragma warning restore 219
Label l1 = DefineLabel();
Label l2 = DefineLabel();
Label l3 = DefineLabel();
LocalBuilder count = _tempV;
LocalBuilder mark = _temp2V;
Label l1 = DefineLabel();
+#pragma warning disable 219
Label l2 = DefineLabel();
Label l3 = _labels[NextCodepos()];
+#pragma warning restore 219
PopStack();
Stloc(count); // count -> temp
// SECREVIEW : Regex only generates string manipulation, so this is
// : ok.
//
+#if !DISABLE_CAS_USE
new ReflectionPermission(PermissionState.Unrestricted).Assert();
+#endif
try {
Debug.Assert(an != null, "AssemblyName should not be null");
CustomAttributeBuilder transparencyAttribute = new CustomAttributeBuilder(transparencyCtor, new object[0]);
assemblyAttributes.Add(transparencyAttribute);
+#if !DISABLE_CAS_USE
ConstructorInfo securityRulesCtor = typeof(SecurityRulesAttribute).GetConstructor(new Type[] { typeof(SecurityRuleSet) });
CustomAttributeBuilder securityRulesAttribute =
new CustomAttributeBuilder(securityRulesCtor, new object[] { SecurityRuleSet.Level2 });
assemblyAttributes.Add(securityRulesAttribute);
-
+#endif
+
_assembly = AppDomain.CurrentDomain.DefineDynamicAssembly(an, AssemblyBuilderAccess.RunAndSave, assemblyAttributes);
_module = _assembly.DefineDynamicModule(an.Name + ".dll");