Browse Source

Added more pointer arithmetic tests

pull/539/head
LordJZ 11 years ago
parent
commit
25f82744a2
  1. 15
      ICSharpCode.Decompiler/Tests/UnsafeCode.cs

15
ICSharpCode.Decompiler/Tests/UnsafeCode.cs

@ -123,6 +123,21 @@ public class UnsafeCode
return this.PointerReferenceExpression((double*)ptr); return this.PointerReferenceExpression((double*)ptr);
} }
public unsafe int* PointerArithmetic(int* p)
{
return p + 2;
}
public unsafe byte* PointerArithmetic2(long* p, int y, int x)
{
return (byte*)p + (y * x);
}
public unsafe long* PointerArithmetic3(long* p)
{
return (long*)((byte*)p + 3);
}
unsafe ~UnsafeCode() unsafe ~UnsafeCode()
{ {
this.PassPointerAsRefParameter(this.NullPointer); this.PassPointerAsRefParameter(this.NullPointer);

Loading…
Cancel
Save