diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2016-09-06 20:48:16 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2016-09-06 20:48:16 -0400 |
commit | 67c401047a472d579cffe629519090ea8ef5c570 (patch) | |
tree | da42bb82324ebe2bc260225f7614f9e25dc81181 /indra/llcommon/llfasttimer.h | |
parent | fe49126d4503a86fb270943fc6c8da5bd50f1303 (diff) |
MAINT-5011: Ensure BlockTimer::mStartTime is unconditionally set.
Previous logic could possibly leave mStartTime uninitialized, producing fatal
warnings with gcc 4.7.
Diffstat (limited to 'indra/llcommon/llfasttimer.h')
-rw-r--r-- | indra/llcommon/llfasttimer.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index 2370253078..f56e5596f5 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -296,7 +296,16 @@ LL_FORCE_INLINE BlockTimer::BlockTimer(BlockTimerStatHandle& timer) { #if LL_FAST_TIMER_ON BlockTimerStackRecord* cur_timer_data = LLThreadLocalSingletonPointer<BlockTimerStackRecord>::getInstance(); - if (!cur_timer_data) return; + if (!cur_timer_data) + { + // How likely is it that + // LLThreadLocalSingletonPointer<T>::getInstance() will return NULL? + // Even without researching, what we can say is that if we exit + // without setting mStartTime at all, gcc 4.7 produces (fatal) + // warnings about a possibly-uninitialized data member. + mStartTime = 0; + return; + } TimeBlockAccumulator& accumulator = timer.getCurrentAccumulator(); accumulator.mActiveCount++; // keep current parent as long as it is active when we are |