Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ internal class RuntimeAssembly : Assembly
private event ModuleResolveEventHandler _ModuleResolve;
private string? m_fullname;
private object? m_syncRoot; // Used to keep collectible types alive and as the syncroot for reflection.emit
#pragma warning disable 169
private IntPtr m_assembly; // slack for ptr datum on unmanaged side
#pragma warning restore 169

#endregion

Expand Down
9 changes: 9 additions & 0 deletions src/binder/assemblyname.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,15 @@ namespace BINDER_SPACE
{
dwUseIdentityFlags &= ~AssemblyIdentity::IDENTITY_FLAG_CONTENT_TYPE;
}
if ((dwIncludeFlags & INCLUDE_PUBLIC_KEY_TOKEN) == 0)
{
dwUseIdentityFlags &= ~AssemblyIdentity::IDENTITY_FLAG_PUBLIC_KEY;
dwUseIdentityFlags &= ~AssemblyIdentity::IDENTITY_FLAG_PUBLIC_KEY_TOKEN;
}
if ((dwIncludeFlags & EXCLUDE_CULTURE) != 0)
{
dwUseIdentityFlags &= ~AssemblyIdentity::IDENTITY_FLAG_CULTURE;
}

dwHash ^= static_cast<DWORD>(HashCaseInsensitive(GetSimpleName()));
dwHash = _rotl(dwHash, 4);
Expand Down
10 changes: 5 additions & 5 deletions src/vm/assemblynative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,18 @@ FCIMPL6(Object*, AssemblyNative::Load, AssemblyNameBaseObject* assemblyNameUNSAF
else
{
// Compute parent assembly
if (gc.requestingAssembly == NULL)
if (gc.requestingAssembly != NULL)
{
pRefAssembly = SystemDomain::GetCallersAssembly(stackMark);
pRefAssembly = gc.requestingAssembly->GetAssembly();
}
else
else if (ptrLoadContextBinder == NULL)
{
pRefAssembly = gc.requestingAssembly->GetAssembly();
pRefAssembly = SystemDomain::GetCallersAssembly(stackMark);
}

if (pRefAssembly)
{
pParentAssembly= pRefAssembly->GetDomainAssembly();
pParentAssembly = pRefAssembly->GetDomainAssembly();
}
}

Expand Down
14 changes: 14 additions & 0 deletions tests/CoreFX/CoreFX.issues.json
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,20 @@
]
}
},
{
"name": "System.Runtime.Loader.DefaultContext.Tests",
"enabled": true,
"exclusions": {
"namespaces": null,
"classes": null,
"methods": [
{
"name" : "System.Runtime.Loader.Tests.DefaultLoadContextTests.LoadInDefaultContext",
"reason" : "Waiting for https://github.com/dotnet/corefx/pull/37071"
}
]
}
},
{
"name": "System.Runtime.Loader.Tests",
"enabled": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@ void TestAssemblyLoad(bool isolated)
{
TestAssemblyLoad(isolated, (string assemblyName) => Assembly.Load(assemblyName));
TestAssemblyLoad(isolated, (string assemblyName) => Assembly.Load(new AssemblyName(assemblyName)));
#pragma warning disable 618
TestAssemblyLoad(isolated, (string assemblyName) => Assembly.LoadWithPartialName(assemblyName));
#pragma warning restore 618
}

void TestAssemblyLoad(bool isolated, Func<string, Assembly> assemblyLoad)
Expand Down Expand Up @@ -748,7 +751,6 @@ public void RunTests(bool isolated)
TestMockAssemblyThrows();
}

[MethodImplAttribute(MethodImplOptions.NoInlining)]
public void RunTestsIsolated()
{
VerifyIsolationAlc();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public interface IProgram
Assembly alcAssembly { get; }
Type alcProgramType { get; }
IProgram alcProgramInstance { get; }
[MethodImplAttribute(MethodImplOptions.NoInlining)]
void RunTestsIsolated();
}

Expand Down