When I load an assembly containing this code, and write it again

    class Program
>     {
>         static void Main(string[] args)
>         {
>             TestPointers();
>         }
>
>         public static void TestPointers()
>         {
>             Console.WriteLine("--- Test pointers ---");
>
>             var a = new[] { 10, 20, 30, 40, 50 };
>
>             unsafe
>             {
>                 fixed (int* p = &a[0])
>                 {
>                     int* p2 = p;
>
>                     Console.WriteLine(*p2);
>                     p2 += 1;
>                     Console.WriteLine(*p2);
>                     p2 += 1;
>                     Console.WriteLine(*p2);
>
>                     Console.WriteLine("---");
>
>                     Console.WriteLine(*p);
>
>                     *p += 1;
>                     Console.WriteLine(*p);
>                     *p += 1;
>                     Console.WriteLine(*p);
>
>                     void* p3 = (void*)p;
>                 }
>             }
>         }
>     }
>
>
then the resulting assembly doesn't pass verification using PEVerify


PEVerify.exe "TestAssembly.new.exe" /md /il /verbose
>
TestAssembly.Program::TestPointers][mdToken=0x6000002][offset 
> 0x00000029][found address of Int32] Expected numeric type on the stack.
> 1 Error(s) Verifying TestAssembly.new.exe
>

Is this a bug? 

-- 
-- 
--
mono-cecil
--- 
You received this message because you are subscribed to the Google Groups 
"mono-cecil" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to