Skip to content

Delete unnecessary clones of the assembly name in Assembly.Load - #1936

Merged
jkotas merged 1 commit into
dotnet:masterfrom
jkotas:assemblyref-clone
Jan 20, 2020
Merged

jkotas merged 1 commit into
dotnet:masterfrom
jkotas:assemblyref-clone

Conversation

@jkotas

@jkotas jkotas commented Jan 20, 2020

Copy link
Copy Markdown
Member

No description provided.

@jkotas jkotas changed the title Delete unnecessary clone of the assembly name Delete unnecessary clones of the assembly name in Assembly.Load Jan 20, 2020
internal static Assembly Load(AssemblyName assemblyRef, ref StackCrawlMark stackMark, AssemblyLoadContext? assemblyLoadContext)
{
AssemblyName modifiedAssemblyRef;
if (assemblyRef.CodeBase != null)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace this by spec.SetCodeBase(NULL); on the unmanaged side.

assemblyRef = (AssemblyName)assemblyRef.Clone();
if (assemblyRef.ProcessorArchitecture != ProcessorArchitecture.None)
{
// PA does not have a semantics for by-name binds for execution

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted ProcessorArchitecture from the AssemblySpec to make sure that this is not necessary. It was not ever used for anything.

&gc.assemblyName,
FALSE);

spec.SetCodeBase(NULL);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kick the codebase ball a bit further...

@jkotas
jkotas merged commit 7c6ec46 into dotnet:master Jan 20, 2020
@jkotas
jkotas deleted the assemblyref-clone branch January 26, 2020 04:35
@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants