Skip to content

Compiler generates invalid IL code for set method bodies #10

Open

Description

@LinuxDoku
.method public hidebysig specialname static 
          string  get_HelloWorldProperty() cil managed
  {
    .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) 
    // Code size       11 (0xb)
    .maxstack  8
    IL_0000:  nop
    IL_0001:  ldstr      "This is a Test"
    //IL_0006:  stloc.0
    //IL_0007:  br.s       IL_0009

    //IL_0009:  ldloc.0
    IL_000a:  ret
  } // end of method Program::get_HelloWorldProperty

The uncommented lines (IL_0006, IL_0007, IL_0009) are generated, but are invalid at this place. So the patched application crashes with a CLR Exception System.InvalidProgramException.

Activity

  1. changed the title [-]Compiler generates invaid IL code for set method bodies[/-] [+]Compiler generates invalid IL code for set method bodies[/+] on Sep 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions