From 25f82744a2007b0889dbce41e1ea6bfbe3696338 Mon Sep 17 00:00:00 2001 From: LordJZ Date: Wed, 18 Feb 2015 14:40:56 +0300 Subject: [PATCH] Added more pointer arithmetic tests --- ICSharpCode.Decompiler/Tests/UnsafeCode.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ICSharpCode.Decompiler/Tests/UnsafeCode.cs b/ICSharpCode.Decompiler/Tests/UnsafeCode.cs index 66fb29529..1a3bd6a0f 100644 --- a/ICSharpCode.Decompiler/Tests/UnsafeCode.cs +++ b/ICSharpCode.Decompiler/Tests/UnsafeCode.cs @@ -122,7 +122,22 @@ public class UnsafeCode } 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() { this.PassPointerAsRefParameter(this.NullPointer);