Where do the Label_ markers appear in Reflector and how to decipher them?

I am trying to understand a method using the Reflector disassembly function. Like anyone who has used this tool, will know that certain code is displayed with C # tags that (presumably) were not used in the original source.

In the 110-line method I'm looking at, there are 11 shortcut operators . Examples of random fragments:

Label_0076:
    if (enumerator.MoveNext())
    {
        goto Label_008F;
    }
    if (!base.IsValid)
    {
        return;
    }
    goto Label_0219;
Label_0087:
    num = 0;
    goto Label_01CB;
Label_01CB:
    if (num < entityArray.Length)
    {
        goto Label_0194;
    }
    goto Label_01AE;
Label_01F3:
    num++;
    goto Label_01CB;

What code makes Reflector display these labels everywhere, and why can't I parse it?

Is there a good technique for decrypting them?

+3
source share
2 answers

, . . , . . , , .

if, , "", case . , , , .

, , , , . , " ", . Reflector , , . ( !), IL - .

, inline goto, goto, . - . , , . ++/CLI - (find/replace → with.), .

; , - .

+3

, # - JIT ( ngen). , , , Reflector, IL . , , iterator. , , , - :

foreach(var x in something)
  if(x.IsValid)
    yield return x;

, Reflector . , , Reflector, , IL #. , .

+7

Source: https://habr.com/ru/post/1716684/


All Articles