You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following program throws InvalidProgramException:
module Program
{
publicstruct Point
{
public X : double {get;set;}
}
publicclass TheClass
{
public Increment() : void { point.X +=1; } // (1)public point : Point;
}
Main() : void
{
def c = TheClass();
c.Increment();
Console.WriteLine(c.point.X);
_ = ReadLine();
}
}
PEVerify output
[IL]: Error: ConsoleApplication2.exe : Program+TheClass::Increment][offset 0x00000007][found value 'Program+Point'][expected address of value 'Program+Point'] Unexpected type on the stack. 1 Error(s) Verifying ConsoleApplication2.exe
Trying to change line (1) to
public Increment() : void { point.X = point.X +1; }
result in successful program execution (and PEVerify tell all is ok), but point.X is not actually changed
The text was updated successfully, but these errors were encountered:
The following program throws InvalidProgramException:
PEVerify output
[IL]: Error: ConsoleApplication2.exe : Program+TheClass::Increment][offset 0x00000007][found value 'Program+Point'][expected address of value 'Program+Point'] Unexpected type on the stack. 1 Error(s) Verifying ConsoleApplication2.exe
Trying to change line (1) to
result in successful program execution (and PEVerify tell all is ok), but point.X is not actually changed
The text was updated successfully, but these errors were encountered: