Skip to content

Latest commit

 

History

History
27 lines (15 loc) · 1.06 KB

iii.4.16-ldstr.md

File metadata and controls

27 lines (15 loc) · 1.06 KB

III.4.16 ldstr – load a literal string

Format Assembly Format Description
72 <T> ldstr string Push a string object for the literal string.

Stack Transition:

…, → …, string

Description:

The ldstr instruction pushes a new string object representing the literal stored in the metadata as string (which is a string literal).

By default, the CLI guarantees that the result of two ldstr instructions referring to two metadata tokens that have the same sequence of characters, return precisely the same string object (a process known as "string interning"). This behavior can be controlled using the System.Runtime.CompilerServices.CompilationRelaxationsAttribute and the System.Runtime.CompilerServices.CompilationRelaxations.NoStringInterning (see Partition IV).

Exceptions:

None.

Correctness:

Correct CIL requires that string is a valid string literal metadata token.

Verifiability:

There are no additional verification requirements.