The following code gives different output when running the release inside Visual Studio, and running the release outside Visual Studio. I\'m using Visual Studio 2008 and targeti
I copied your code into a new Console App.
So it is the x86 JIT incorrectly generating the code. Have deleted my original text about reordering of loops etc. A few other answers on here have confirmed that the JIT is unwinding the loop incorrectly when on x86.
To fix the problem you can change the declaration of IntVec to a class and it works in all flavours.
Think this needs to go on MS Connect....
-1 to Microsoft!