Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

[no merge] Introduce a new attribute indicating a method uses StackCrawlMark #7449

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/mscorlib/mscorlib.shared.sources.props
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\YieldAwaitable.cs" />
<CompilerServicesSources Condition="'$(FeatureCominterop)' == 'true'" Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\IDispatchConstantAttribute.cs" />
<CompilerServicesSources Condition="'$(FeatureCoreClr)'!='true'" Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\IUnknownConstantAttribute.cs" />
<CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\UsesStackCrawlMarkAttribute.cs" />
</ItemGroup>
<ItemGroup>
<ReliabilitySources Include="$(BclSourcesRoot)\System\Runtime\Reliability\CriticalFinalizerObject.cs" />
Expand Down
14 changes: 7 additions & 7 deletions src/mscorlib/src/System/Activator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static public Object CreateInstance(Type type,
}

[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
static public Object CreateInstance(Type type,
BindingFlags bindingAttr,
Binder binder,
Expand Down Expand Up @@ -139,7 +139,7 @@ static public Object CreateInstance(Type type)
*/

[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
static public ObjectHandle CreateInstance(String assemblyName,
String typeName)
{
Expand All @@ -157,7 +157,7 @@ static public ObjectHandle CreateInstance(String assemblyName,
}

[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
static public ObjectHandle CreateInstance(String assemblyName,
String typeName,
Object[] activationAttributes)
Expand All @@ -176,7 +176,7 @@ static public ObjectHandle CreateInstance(String assemblyName,
ref stackMark);
}

[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
static public Object CreateInstance(Type type, bool nonPublic)
{
if ((object)type == null)
Expand All @@ -192,7 +192,7 @@ static public Object CreateInstance(Type type, bool nonPublic)
return rt.CreateInstanceDefaultCtor(!nonPublic, false, true, ref stackMark);
}

[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
static public T CreateInstance<T>()
{
RuntimeType rt = typeof(T) as RuntimeType;
Expand Down Expand Up @@ -231,7 +231,7 @@ static public ObjectHandle CreateInstanceFrom(String assemblyFile,
}

[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
[Obsolete("Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of CreateInstance which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
static public ObjectHandle CreateInstance(String assemblyName,
String typeName,
Expand All @@ -257,7 +257,7 @@ static public ObjectHandle CreateInstance(String assemblyName,
}

[SecuritySafeCritical]
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
public static ObjectHandle CreateInstance(string assemblyName,
string typeName,
bool ignoreCase,
Expand Down
40 changes: 20 additions & 20 deletions src/mscorlib/src/System/AppDomain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ private void EnableResolveAssembliesForIntrospection(string verifiedFileDirector
* is saved.
**********************************************/
[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
public AssemblyBuilder DefineDynamicAssembly(
AssemblyName name,
AssemblyBuilderAccess access)
Expand All @@ -1197,7 +1197,7 @@ public AssemblyBuilder DefineDynamicAssembly(
}

[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
public AssemblyBuilder DefineDynamicAssembly(
AssemblyName name,
AssemblyBuilderAccess access,
Expand Down Expand Up @@ -1232,7 +1232,7 @@ public AssemblyBuilder DefineDynamicAssembly(AssemblyName name,
}

[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
public AssemblyBuilder DefineDynamicAssembly(
AssemblyName name,
AssemblyBuilderAccess access,
Expand All @@ -1249,7 +1249,7 @@ public AssemblyBuilder DefineDynamicAssembly(
}

[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
[Obsolete("Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
public AssemblyBuilder DefineDynamicAssembly(
AssemblyName name,
Expand All @@ -1267,7 +1267,7 @@ public AssemblyBuilder DefineDynamicAssembly(
}

[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
[Obsolete("Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
public AssemblyBuilder DefineDynamicAssembly(
AssemblyName name,
Expand All @@ -1289,7 +1289,7 @@ public AssemblyBuilder DefineDynamicAssembly(
}

[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
[Obsolete("Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of DefineDynamicAssembly which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkId=155570 for more information.")]
public AssemblyBuilder DefineDynamicAssembly(
AssemblyName name,
Expand All @@ -1305,7 +1305,7 @@ public AssemblyBuilder DefineDynamicAssembly(
}

[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
[Obsolete("Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
public AssemblyBuilder DefineDynamicAssembly(
AssemblyName name,
Expand All @@ -1328,7 +1328,7 @@ public AssemblyBuilder DefineDynamicAssembly(
}

[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
[Obsolete("Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
public AssemblyBuilder DefineDynamicAssembly(
AssemblyName name,
Expand All @@ -1352,7 +1352,7 @@ public AssemblyBuilder DefineDynamicAssembly(
}

[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
[Obsolete("Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. Please see http://go.microsoft.com/fwlink/?LinkId=155570 for more information.")]
public AssemblyBuilder DefineDynamicAssembly(
AssemblyName name,
Expand All @@ -1378,7 +1378,7 @@ public AssemblyBuilder DefineDynamicAssembly(


[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
[Obsolete("Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
public AssemblyBuilder DefineDynamicAssembly(
AssemblyName name,
Expand Down Expand Up @@ -1406,7 +1406,7 @@ public AssemblyBuilder DefineDynamicAssembly(
}

[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
[Obsolete("Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
public AssemblyBuilder DefineDynamicAssembly(
AssemblyName name,
Expand Down Expand Up @@ -1435,7 +1435,7 @@ public AssemblyBuilder DefineDynamicAssembly(
}

[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
public AssemblyBuilder DefineDynamicAssembly(
AssemblyName name,
AssemblyBuilderAccess access,
Expand All @@ -1459,7 +1459,7 @@ public AssemblyBuilder DefineDynamicAssembly(
}

[System.Security.SecurityCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
private AssemblyBuilder InternalDefineDynamicAssembly(
AssemblyName name,
AssemblyBuilderAccess access,
Expand Down Expand Up @@ -1782,23 +1782,23 @@ internal ObjectHandle InternalCreateInstanceFromWithNoSecurity (string assemblyN
}

[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
public Assembly Load(AssemblyName assemblyRef)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.InternalLoadAssemblyName(assemblyRef, null, null, ref stackMark, true /*thrownOnFileNotFound*/, false, false);
}

[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
public Assembly Load(String assemblyString)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.InternalLoad(assemblyString, null, ref stackMark, false);
}

[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
public Assembly Load(byte[] rawAssembly)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
Expand All @@ -1812,7 +1812,7 @@ public Assembly Load(byte[] rawAssembly)
}

[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
public Assembly Load(byte[] rawAssembly,
byte[] rawSymbolStore)
{
Expand All @@ -1829,7 +1829,7 @@ public Assembly Load(byte[] rawAssembly,
#pragma warning disable 618
[SecurityPermissionAttribute(SecurityAction.Demand, ControlEvidence = true)]
#pragma warning restore 618
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
[Obsolete("Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of Load which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkId=155570 for more information.")]
public Assembly Load(byte[] rawAssembly,
byte[] rawSymbolStore,
Expand All @@ -1852,7 +1852,7 @@ public Assembly Load(byte[] rawAssembly,
}

[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
[Obsolete("Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of Load which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
public Assembly Load(AssemblyName assemblyRef,
Evidence assemblySecurity)
Expand All @@ -1862,7 +1862,7 @@ public Assembly Load(AssemblyName assemblyRef,
}

[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
[Obsolete("Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of Load which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
public Assembly Load(String assemblyString,
Evidence assemblySecurity)
Expand Down
4 changes: 2 additions & 2 deletions src/mscorlib/src/System/Delegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ public static Delegate CreateDelegate(Type type, Type target, String method, boo

// V1 API.
[System.Security.SecuritySafeCritical]
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
public static Delegate CreateDelegate(Type type, MethodInfo method, bool throwOnBindFailure)
{
// Validate the parameters.
Expand Down Expand Up @@ -495,7 +495,7 @@ public static Delegate CreateDelegate(Type type, Object firstArgument, MethodInf

// V2 API.
[System.Security.SecuritySafeCritical]
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[UsesStackCrawlMark]
public static Delegate CreateDelegate(Type type, Object firstArgument, MethodInfo method, bool throwOnBindFailure)
{
// Validate the parameters.
Expand Down
Loading