From 01c0e96083ae7678ee1b741d2fb353a24df942c4 Mon Sep 17 00:00:00 2001 From: Patrick Stevens <3138005+Smaug123@users.noreply.github.com> Date: Fri, 4 Jul 2025 12:29:20 +0100 Subject: [PATCH 1/2] Fix wording of ldloca description (#11313) --- xml/System.Reflection.Emit/OpCodes.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xml/System.Reflection.Emit/OpCodes.xml b/xml/System.Reflection.Emit/OpCodes.xml index f25ae62e5b4..e9a884a9ae6 100644 --- a/xml/System.Reflection.Emit/OpCodes.xml +++ b/xml/System.Reflection.Emit/OpCodes.xml @@ -10358,7 +10358,7 @@ The following method overloads The stack transitional behavior, in sequential order, is: -1. The address stored in the local variable at the specified index is pushed onto the stack. +1. The address of the local variable at the specified index is pushed onto the stack. 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 and . 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. @@ -10420,7 +10420,7 @@ The following method overloads The stack transitional behavior, in sequential order, is: -1. The address stored in the local variable at the specified index is pushed onto the stack. +1. The address of the local variable at the specified index is pushed onto the stack. The `ldloca.s` 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 and . The result is a transient pointer (type `*`). From 03a95c552c8120a7d453209fcead018c4482aba1 Mon Sep 17 00:00:00 2001 From: Patrick Stevens <3138005+Smaug123@users.noreply.github.com> Date: Sat, 5 Jul 2025 05:02:13 +0100 Subject: [PATCH 2/2] Fix description of pointer in ldloca.s (#11314) Apply https://github.com/dotnet/dotnet-api-docs/pull/9574 to ldloca.s. --------- Co-authored-by: Jan Kotas --- xml/System.Reflection.Emit/OpCodes.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml/System.Reflection.Emit/OpCodes.xml b/xml/System.Reflection.Emit/OpCodes.xml index e9a884a9ae6..154ba0158c1 100644 --- a/xml/System.Reflection.Emit/OpCodes.xml +++ b/xml/System.Reflection.Emit/OpCodes.xml @@ -10422,7 +10422,7 @@ The following method overloads 1. The address of the local variable at the specified index is pushed onto the stack. - The `ldloca.s` 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 and . The result is a transient pointer (type `*`). + The `ldloca.s` 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 and . 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. The `ldloca.s` instruction provides an efficient encoding for use with the local variables 0 through 255.