Skip to content

Commit

Permalink
Support Unmanaged call conv
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfsck committed Jun 29, 2020
1 parent f895c90 commit 651e304
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/DotNet/CallingConvention.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public enum CallingConvention : byte {
LocalSig = 0x7,
/// <summary/>
Property = 0x8,
/// <summary/>
/// <summary>Unmanaged calling convention encoded as modopts</summary>
Unmanaged = 0x9,
/// <summary>generic method instantiation</summary>
GenericInst = 0xA,
Expand Down
4 changes: 2 additions & 2 deletions src/DotNet/SigComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2218,6 +2218,7 @@ public bool Equals(CallingConventionSig a, CallingConventionSig b) {
case CallingConvention.VarArg:
case CallingConvention.Property:
case CallingConvention.NativeVarArg:
case CallingConvention.Unmanaged:
MethodBaseSig ma = a as MethodBaseSig, mb = b as MethodBaseSig;
result = !(ma is null) && !(mb is null) && Equals(ma, mb);
break;
Expand All @@ -2237,7 +2238,6 @@ public bool Equals(CallingConventionSig a, CallingConventionSig b) {
result = !(ga is null) && !(gb is null) && Equals(ga, gb);
break;

case CallingConvention.Unmanaged:
default:
result = false;
break;
Expand Down Expand Up @@ -2269,6 +2269,7 @@ public int GetHashCode(CallingConventionSig a) {
case CallingConvention.VarArg:
case CallingConvention.Property:
case CallingConvention.NativeVarArg:
case CallingConvention.Unmanaged:
var ma = a as MethodBaseSig;
hash = ma is null ? 0 : GetHashCode(ma);
break;
Expand All @@ -2288,7 +2289,6 @@ public int GetHashCode(CallingConventionSig a) {
hash = ga is null ? 0 : GetHashCode(ga);
break;

case CallingConvention.Unmanaged:
default:
hash = GetHashCode_CallingConvention(a);
break;
Expand Down
2 changes: 1 addition & 1 deletion src/DotNet/SignatureReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ CallingConventionSig ReadSig() {
case CallingConvention.FastCall:
case CallingConvention.VarArg:
case CallingConvention.NativeVarArg:
case CallingConvention.Unmanaged:
result = ReadMethod(callingConvention);
break;

Expand All @@ -449,7 +450,6 @@ CallingConventionSig ReadSig() {
result = ReadGenericInstMethod(callingConvention);
break;

case CallingConvention.Unmanaged:
default:
result = null;
break;
Expand Down

0 comments on commit 651e304

Please sign in to comment.