Why is IBM Rational Purify unable to detect UMR for a variable if it is un-initialized?
Answer
This is a limitation of the product.
With only one variable in a class, the Microsoft C++ compiler is using one of the processor registers for handling its value. Note that [this] value is also passed in the ECX register.
Example:
mov EAX, ECX
mov EAX, [EAX]
push EAX
...
This pattern may change depending on the class implementation.
There is no obvious data access when everything is in the processor registers. We can not always assume that ECX register contains this pointer, because it is C++ code specific. In theory Purify could recognize this pointer access if it were to take advantage of the debugger information, however to do this is a complex task.
When you add a second variable to the class, the compiler does not keep it in a register, so Purify has a chance to see it.
IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.
Rate this page
Please take a moment to complete this form to help us better serve you.