Call `SetParentAssembly` when binding from native manifest (#34924)
authorSimon Nattress <nattress@gmail.com>
Tue, 14 Apr 2020 22:14:42 +0000 (15:14 -0700)
committerGitHub <noreply@github.com>
Tue, 14 Apr 2020 22:14:42 +0000 (15:14 -0700)
In large version bubble mode, Crossgen2 uses the native manifest table to encode assembly references. When a referenced module is decoded and an `AssemblySpec` is created, set the parent assembly for the bind.

Fixes Loader\binding\tracing\BinderTracingTest.Basic regression, which checks parent assembly is correctly set in the bind result.

src/coreclr/src/vm/zapsig.cpp

index e07520c..f0b8361 100644 (file)
@@ -658,6 +658,7 @@ Module *ZapSig::DecodeModuleFromIndex(Module *fromModule,
                 spec.InitializeSpec(TokenFromRid(index, mdtAssemblyRef),
                                 fromModule->GetNativeAssemblyImport(),
                                 NULL);
+                spec.SetParentAssembly(fromModule->GetDomainAssembly());
                 pAssembly = spec.LoadAssembly(FILE_LOADED);
             }
             fromModule->SetNativeMetadataAssemblyRefInCache(index, pAssembly);