OperationCode.Cpblk

Apr 12, 2010 at 6:19 AM
Edited Apr 12, 2010 at 6:31 AM

HI,

In the source code of ParseInstruction method (in SourceMethodBody.cs of ILToCodeModel project) you have this block

 

        case OperationCode.Initblk:
          //TODO: need to capture this in the code model
          this.PopOperandStack();
          this.PopOperandStack();
          this.PopOperandStack();
          Debug.Assert(false); //if code out there actually uses this, I need to know sooner rather than later.
          break;
        case OperationCode.Cpblk:
          //TODO: need to capture this in the code model
          this.PopOperandStack();
          this.PopOperandStack();
          this.PopOperandStack();
//          Debug.Assert(false); //if code out there actually uses this, I need to know sooner rather than later.
          break;

 I did come across the use of Initblk and  Cpblk here:

Assembly: Microsoft.Transactions.Bridge.Dtc.dll  (Part of the WCF Framework) 

Type: <Module>

Method: ManagedToUnmanagedGuid

I use reflector to look at the method and this is the IL

.method assembly static valuetype _GUID ManagedToUnmanagedGuid(valuetype [mscorlib]System.Guid guid) cil managed
{
    .maxstack 3
    .locals (
        [0] valuetype _GUID _guid)
    L_0000: ldloca.s _guid
    L_0002: ldarga.s guid
    L_0004: conv.i4 
    L_0005: ldc.i4.s 0x10
    L_0007: cpblk 
    L_0009: ldloc.0 
    L_000a: ret 
}
 

Since you put that comment in the code, I thought you might be interested to know about this.

Regards,

Fadrian