The two locals IsNew and Pointer_IsNew were uninitialized at declaration, and then passed by reference to Device.getOrAllocTgtPtr which in turn did not assign on all paths within the function. This resulted in occasional runtime failures in one application. Device::getOrAllocTgtPtr will now initialize IsNew to false on entry to function.
Details
Details
Diff Detail
Diff Detail
Unit Tests
Unit Tests
Event Timeline
Comment Actions
I think it would look better if we initialized those variables inside Device::getOrAllocTgtPtr - the caller should not assume any default value. That's also what happens in target_data_end with the IsLast variable, it is initialized inside Device::getTgtPtrBegin.