Skip to content

Instantly share code, notes, and snippets.

@gdyrrahitis

gdyrrahitis/boxing.cs Secret

Created Jun 22, 2019
Embed
What would you like to do?
.method public hidebysig
instance void CallingMethodWithObjectParam () cil managed
{
// Method begins at RVA 0x2068
// Code size 16 (0x10)
.maxstack 2
.locals init (
[0] int32
)
IL_0000: ldc.i4.s 100
IL_0002: stloc.0
IL_0003: ldarg.0
IL_0004: ldloc.0
IL_0005: box [System.Runtime]System.Int32 // First boxes the value type
IL_000a: call instance void Boxing.Unboxing.Class2::SignatureWithObjectParam(object) // Now calls the method with the boxed value type
IL_000f: ret
} // end of method Class2::CallingMethodWithObjectParam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment