diff options
author | Jo Shields <directhex@apebox.org> | 2014-02-19 22:12:43 +0000 |
---|---|---|
committer | Jo Shields <directhex@apebox.org> | 2014-02-19 22:12:43 +0000 |
commit | 9972bf87b4f27d9c8f358ef8414ac1ab957a2f0f (patch) | |
tree | 5bb230c1d698659115f918e243c1d4b0aa4c7f51 /mcs/ilasm/codegen/ExternTable.cs | |
parent | d0a215f5626219ff7927f576588a777e5331c7be (diff) | |
download | mono-upstream/3.2.8+dfsg.tar.gz |
Imported Upstream version 3.2.8+dfsgupstream/3.2.8+dfsg
Diffstat (limited to 'mcs/ilasm/codegen/ExternTable.cs')
-rw-r--r-- | mcs/ilasm/codegen/ExternTable.cs | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/mcs/ilasm/codegen/ExternTable.cs b/mcs/ilasm/codegen/ExternTable.cs index 25a46efbf3..1e41fe720c 100644 --- a/mcs/ilasm/codegen/ExternTable.cs +++ b/mcs/ilasm/codegen/ExternTable.cs @@ -251,13 +251,13 @@ namespace Mono.ILASM { public class ExternClass { - string name; + string fullName; TypeAttr ta; string assemblyReference; - public ExternClass (string name, TypeAttr ta, string assemblyReference) + public ExternClass (string fullName, TypeAttr ta, string assemblyReference) { - this.name = name; + this.fullName = fullName; this.ta = ta; this.assemblyReference = assemblyReference; } @@ -265,8 +265,18 @@ namespace Mono.ILASM { public void Resolve (CodeGen code_gen, ExternTable table) { var ar = table.GetAssemblyRef (assemblyReference); - if (ar != null) - code_gen.PEFile.AddExternClass (name, ta, ar.AssemblyRef); + if (ar != null) { + string ns = null; + string name = fullName; + + int pos = name.LastIndexOf ('.'); + if (pos > 0) { + ns = name.Substring (0, pos); + name = name.Substring (pos + 1); + } + + code_gen.PEFile.AddExternClass (ns, name, ta, ar.AssemblyRef); + } } } |