[Mono-list] SecurityIdentifier and IdentityReference op_Equality

Bruce Wilkie bruce at bwilkie.com
Wed Aug 8 10:57:43 EDT 2007


while doing some offline code analysis, these two classes in the System.Security.Principal namespace appear to have infinite recursion in their op_Equality methods:

C#:
----
  public static bool operator == (SecurityIdentifier left, SecurityIdentifier right)
  {
   if (left == null)
    return (right == null);
   if (right == null)
    return false;
   return (left.Value == right.Value);
  }
----
IL:
----
  IL_0000:  ldarg.0
  IL_0001:  ldnull
  IL_0002:  call       bool System.Security.Principal.SecurityIdentifier::op_Equality(class System.Security.Principal.SecurityIdentifier,
                                                                                      class System.Security.Principal.SecurityIdentifier)
  IL_0007:  brfalse.s  IL_0011
  IL_0009:  ldarg.1
  IL_000a:  ldnull
  IL_000b:  call       bool System.Security.Principal.SecurityIdentifier::op_Equality(class System.Security.Principal.SecurityIdentifier,
                                                                                      class System.Security.Principal.SecurityIdentifier)
  IL_0010:  ret
  IL_0011:  ldarg.1
  IL_0012:  ldnull
  IL_0013:  call       bool System.Security.Principal.SecurityIdentifier::op_Equality(class System.Security.Principal.SecurityIdentifier,
                                                                                      class System.Security.Principal.SecurityIdentifier)
  IL_0018:  brfalse.s  IL_001c
  IL_001a:  ldc.i4.0
  IL_001b:  ret
  IL_001c:  ldarg.0
  IL_001d:  callvirt   instance string System.Security.Principal.IdentityReference::get_Value()
  IL_0022:  ldarg.1
  IL_0023:  callvirt   instance string System.Security.Principal.IdentityReference::get_Value()
  IL_0028:  call       bool System.String::op_Equality(string,
                                                       string)
  IL_002d:  ret
----

i don't think i use those two functions, but just curious if others have seen this.  am i missing something?  :)

thx,
bruce


More information about the Mono-list mailing list