Bug only occurring when compile optimization enabled

前端 未结 5 1844
無奈伤痛
無奈伤痛 2020-12-23 11:21

I came across a bug in code that is only reproduced when the code is built with optimizations enabled. I\'ve made a console app that replicates the logic for testing (code

5条回答
  •  醉梦人生
    2020-12-23 11:55

    This bug seems to have been fixed in .NET 4 (beta 2). Here's the optimized x86 disassembly for the bit nobugz highlighted, above:

                        Console.WriteLine("Post-check Value is: " + value);
    00000056  mov         ecx,dword ptr ds:[033C2090h] 
    0000005c  mov         edx,dword ptr [ebp-8] 
    0000005f  call        65D8FE10
    

    The program also displays the expected output in both optimized and unoptimized modes.

提交回复
热议问题