The information in this article applies to:
SYMPTOMSIf you access a structure member when using an unsigned char index in a For loop, a general protection (GP) fault occurs. CAUSEWhen the compiler is optimizing for speed, only the low byte of the register where the index is stored is zeroed. Later on, the full extended register is used in calculating the offset of the structure member. Because the rest of the register is never zeroed, the offset used is invalid. RESOLUTION
Use either one of the following workarounds:
-or- STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Microsoft Visual C++, 32-bit Edition, version 4.0. MORE INFORMATION
The sample code below can be used to demonstrate the problem.
Sample Code to Reproduce Problem
Additional query words: 2.00 2.10 VCx86 GPF
Keywords : kbCompiler |
Last Reviewed: January 20, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |