Jason He's WebLog

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
{
    .entrypoint
    .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)
 

 

Published Wednesday, October 17, 2007 2:09 PM by ZifengH

Comments

 

Techy News Blog » MSIL Verification Notes - 9 said:

October 17, 2007 2:21 PM
Anonymous comments are disabled

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker