[mono/mono] 8332e5db: [linker] Do not import something that is not marked when sweeping type references (otherwise we might re-intoduce dependencies we're not including or need) [#16213]
| Newsgroups | gmane.comp.gnome.mono.patches |
|---|---|
| Message-ID | <00000142547e5bb8-17b1ac2d-a701-4df9-a9c2-bd9e1e300727-000000@email.amazonses.com> |
Branch: refs/heads/master
Home: https://github.com/mono/mono
Compare: https://github.com/mono/mono/compare/4fc5a4ce3493...8332e5db5695
Commit: 8332e5db5695012f6e3f0d8eff78dfc05fc67864
Author: Sebastien Pouliot <[email protected]> (spouliot)
Date: 2013-11-14 02:42:18 GMT
URL: https://github.com/mono/mono/commit/8332e5db5695012f6e3f0d8eff78dfc05fc67864
[linker] Do not import something that is not marked when sweeping type references (otherwise we might re-intoduce dependencies we're not including or need) [#16213]
Changed paths:
M mcs/tools/linker/Mono.Linker.Steps/SweepStep.cs
Modified: mcs/tools/linker/Mono.Linker.Steps/SweepStep.cs
===================================================================
@@ -94,6 +94,9 @@ void SweepReferences (AssemblyDefinition target)
void SweepReferences (AssemblyDefinition assembly, AssemblyDefinition target)
{
+ if (assembly == target)
+ return;
+
var references = assembly.MainModule.AssemblyReferences;
for (int i = 0; i < references.Count; i++) {
var reference = references [i];
@@ -134,8 +137,11 @@ void ResolveAllTypeReferences (AssemblyDefinition assembly)
if (hash.ContainsKey (tr))
continue;
var td = tr.Resolve ();
+ IMetadataScope scope = tr.Scope;
// at this stage reference might include things that can't be resolved
- var scope = td == null ? null : assembly.MainModule.Import (td).Scope;
+ // and if it is (resolved) it needs to be kept only if marked (#16213)
+ if ((td != null) && Annotations.IsMarked (td))
+ scope = assembly.MainModule.Import (td).Scope;
hash.Add (tr, scope);
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches