diff options
author | jbevain <jbevain@gmail.com> | 2011-02-22 16:44:54 +0300 |
---|---|---|
committer | jbevain <jbevain@gmail.com> | 2011-02-22 16:44:54 +0300 |
commit | 595db9a468c99c7094db417a9daf2b65045ea4c5 (patch) | |
tree | 06e4706472d707b42081099014f5dbe108926532 /Mono.Cecil | |
parent | 5164e79b52da8f66d6131af64d183d45cac6257d (diff) |
Fix cleaning of callconv flags
Diffstat (limited to 'Mono.Cecil')
-rw-r--r-- | Mono.Cecil/AssemblyReader.cs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Mono.Cecil/AssemblyReader.cs b/Mono.Cecil/AssemblyReader.cs index 64e330a..c864af8 100644 --- a/Mono.Cecil/AssemblyReader.cs +++ b/Mono.Cecil/AssemblyReader.cs @@ -2704,9 +2704,21 @@ namespace Mono.Cecil { public void ReadMethodSignature (IMethodSignature method) { var calling_convention = ReadByte (); + + const byte has_this = 0x20; + const byte explicit_this = 0x40; + + if ((calling_convention & has_this) != 0) { + method.HasThis = true; + calling_convention = (byte) (calling_convention & ~has_this); + } + + if ((calling_convention & explicit_this) != 0) { + method.ExplicitThis = true; + calling_convention = (byte) (calling_convention & ~explicit_this); + } + method.CallingConvention = (MethodCallingConvention) calling_convention; - method.HasThis = (calling_convention & 0x20) != 0; - method.ExplicitThis = (calling_convention & 0x40) != 0; var generic_context = method as MethodReference; if (generic_context != null) @@ -2719,8 +2731,6 @@ namespace Mono.Cecil { CheckGenericContext (generic_context, (int) arity -1 ); } - // TODO: more call_conv - var param_count = ReadCompressedUInt32 (); method.MethodReturnType.ReturnType = ReadTypeSignature (); |