FIX: Application Error If /Og & Virtual Operator Call in Loop (131000)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Professional Edition 2.0
- Microsoft Visual C++, 32-bit Professional Edition 2.1
This article was previously published under Q131000 SYMPTOMS
An application error is generated when running a program that meets all
these conditions:
- It was compiled with global optimization (/Og).
- It defines a virtual operator for a class.
- It constructs an object of that class inside a loop.
- The operator is called inside the loop.
CAUSE
The computation of the address of the virtual operator is being lifted out
of the loop.
RESOLUTION
Use any one of the following four workarounds:
- Move the object outside the loop.
-or-
- Use the functional form of the operator.
-or-
- If the operator does not need to be virtual, do not declare it virtual.
-or-
- Do not do global optimizations.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This problem was fixed in Microsoft
Visual C++, 32-bit Edition, version 4.0.
Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
---|
Keywords: | kbbug kbCodeGen kbCompiler kbCPPonly kbfix KB131000 |
---|
|