Comments
2 comments
-
-> seems to be used correctly in some circumstances.
For example, in the following,public struct Foo { public unsafe Foo* x; public int y; } static void Main(string[] args) { unsafe { Foo foo = new Foo(); int xx = foo.x->y; Foo* bar = &foo; int yy = bar->x->y; } }
Reflector uses -> for the top level indirections.Foo foo = new Foo(); int y = foo.x.y; Foo* fooPtr = &foo; int num2 = fooPtr->x.y;
I've logged it as RP-947. -
Thank you
Add comment
Please sign in to leave a comment.
does Reflector 7 support pointers? (ie unsafe types)
I'm asking because instead of pointers (->) I see the points (.)
Example:
public struct struct012c
{
public const int f00002e = 0x80;
public const int f00000f = 280;
public uint f00003f;
public uint f000040;
public uint f000031;
public enum0128 f00021a;
public unsafe struct0125* f000225;
public uint f000034;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=0x80, ArraySubType=UnmanagedType.U2)]
public char[] f0001e7;
}
and here is the usage (wrong):
public static unsafe int m000152(IntPtr A_0, uint A_1, delegate012e A_2, enum0130 A_3)
{
int num2;
int cb = sizeof(struct0125) + 0x10000;
IntPtr hglobal = Marshal.AllocHGlobal(cb);
try
{
struct012c structc;
structc = new struct012c {
f0001e7 = new char[0x80],
f00003f = (uint) Marshal.SizeOf(structc),
f000031 = A_1,
f000225 = (struct0125*) hglobal
};
structc.f000225.f000112 = (ushort) A_1;
structc.f000034 = (uint) cb;
num2 = acmFormatEnum(A_0, ref structc, A_2, IntPtr.Zero, A_3);
}
finally
{
Marshal.FreeHGlobal(hglobal);
}
return num2;
}
Please comment