Signatures are stored in the metadata Blob heap. In most cases, they are indexed by a column in some table—Field.Signature, Method.Signature, MemberRef.Signature, etc. However, there are two cases that require a metadata token for a signature that is not indexed by any metadata table. The StandAloneSig table fulfils this need. It has just one column, which points to a Signature in the Blob heap.
The signature shall describe either:
-
a method – code generators create a row in the StandAloneSig table for each occurrence of a
calli
CIL instruction. That row indexes the call-site signature for the function pointer operand of thecalli
instruction -
local variables – code generators create one row in the StandAloneSig table for each method, to describe all of its local variables. The .locals directive (§II.15.4.1) in ILAsm generates a row in the StandAloneSig table.
The StandAloneSig table has the following column:
- Signature (an index into the Blob heap)
[Example:
// On encountering the calli instruction, ilasm generates a signature
// in the blob heap (DEFAULT, ParamCount = 1, RetType = int32, Param1 = int32),
// indexed by the StandAloneSig table:
.assembly Test {}
.method static int32 AddTen(int32)
{ ldarg.0
ldc.i4 10
add
ret
}
.class Test
{ .method static void main()
{ .entrypoint
ldc.i4.1
ldftn int32 AddTen(int32)
calli int32(int32)
pop
ret
}
}
end example]
This contains informative text only.
-
The StandAloneSig table can contain zero or more rows
-
Signature shall index a valid signature in the Blob heap [ERROR]
-
The signature 'blob' indexed by Signature shall be a valid
METHOD
orLOCALS
signature [ERROR] -
Duplicate rows are allowed
End informative text.