mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Use non-virtual call to invoke 'family or assembly' methods on base class from PowerShell class (#7622) (#7624)
This commit is contained in:
committed by
Dongbo Wang
parent
358e8abefe
commit
165f2c9a42
@@ -1230,7 +1230,7 @@ namespace System.Management.Automation
|
||||
var parameterTypes = methodInfo.method.GetParameters().Select(parameter => parameter.ParameterType).ToArray();
|
||||
var targetTypeMethod = invocationConstraints.MethodTargetType.GetMethod(methodInfo.method.Name, BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null, parameterTypes, null);
|
||||
|
||||
if (targetTypeMethod != null && (targetTypeMethod.IsPublic || targetTypeMethod.IsFamily))
|
||||
if (targetTypeMethod != null && (targetTypeMethod.IsPublic || targetTypeMethod.IsFamily || targetTypeMethod.IsFamilyOrAssembly))
|
||||
{
|
||||
methodInfo = new MethodInformation(targetTypeMethod, 0);
|
||||
callNonVirtually = true;
|
||||
|
||||
Reference in New Issue
Block a user