MSIL Verification Notes – 9


Tail call verification rules require that no managed pointers to be passed from caller to callee if it points to a stack frame that to be removed. ArgIterator does not satisfy the condition. Therefore below code will not be verifiable. 
.method public hidebysig static void Main(string[] A_0) cil managed
.maxstack 8
.locals init (
[0] valuetype [mscorlib]System.ArgIterator args)
L_0000: ldloc args
L_0004: tail
L_0006: call void TestClass::t(valuetype [mscorlib]System.ArgIterator)
L_000b: ret
The PEverify result is
[IL]: Error: [xxx.exe : TestClass::Main][mdToken=0x6000002][offset 0x00000006][found value ‘System.ArgIterator’] Cannot pass ByRef to a tail call.(Error: 0x80131899)


Skip to main content