Skip to content

Commit a31d808

Browse files
Fix invalid pointer types in ldloca/ldarga descriptions (#9574)
1 parent 657807b commit a31d808

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

xml/System.Reflection.Emit/OpCodes.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6680,7 +6680,7 @@
66806680

66816681
1. The address `addr` of the argument indexed by `index` is pushed onto the stack.
66826682

6683-
The `ldarga` instruction fetches the address (of type `*`) of the argument indexed by `index`, where arguments are indexed from 0 onwards. The address `addr` is always aligned to a natural boundary on the target machine.
6683+
The `ldarga` instruction fetches the address (of type `&`) of the argument indexed by `index`, where arguments are indexed from 0 onwards. The address `addr` is always aligned to a natural boundary on the target machine. The argument is stored in unmanaged memory, so the return value can be converted to an unmanaged pointer without pinning.
66846684

66856685
For procedures that take a variable-length argument list, the `ldarga` instruction can be used only for the initial fixed arguments, not those in the variable part of the signature.
66866686

@@ -10213,7 +10213,7 @@ The following <xref:System.Reflection.Emit.ILGenerator.Emit%2A> method overloads
1021310213

1021410214
1. The address stored in the local variable at the specified index is pushed onto the stack.
1021510215

10216-
The `ldloca` instruction pushes the address of the local variable number at the passed index onto the stack, where local variables are numbered 0 onwards. The value pushed on the stack is already aligned correctly for use with instructions like <xref:System.Reflection.Emit.OpCodes.Ldind_I> and <xref:System.Reflection.Emit.OpCodes.Stind_I>. The result is a transient pointer (type `*`).
10216+
The `ldloca` instruction pushes the address of the local variable number at the passed index onto the stack, where local variables are numbered 0 onwards. The value pushed on the stack is already aligned correctly for use with instructions like <xref:System.Reflection.Emit.OpCodes.Ldind_I> and <xref:System.Reflection.Emit.OpCodes.Stind_I>. The result is a managed pointer (type `&`). The local variable is stored in unmanaged memory, so the return value can be converted to an unmanaged pointer without pinning.
1021710217

1021810218
The following <xref:System.Reflection.Emit.ILGenerator.Emit%2A> method overload can use the `ldloca` opcode:
1021910219

0 commit comments

Comments
 (0)