[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 8340ac54 04/13: Fix defect introduced 2005011
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 8340ac54 04/13: Fix defect introduced 20050114T1947Z: use before initialization |
Date: |
Fri, 10 Jun 2022 21:09:37 -0400 (EDT) |
branch: master
commit 8340ac54a465dd5b132afdfb2d38d730c7241f4d
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Fix defect introduced 20050114T1947Z: use before initialization
'daily_interest_accounting' had been used before initialization.
Defect identified by ASan [reformatted]:
#0 in AccountValue::CoordinateCounters() ihs_acctval.cpp:1486
#1 in AccountValue::SetInitialValues() ihs_acctval.cpp:614
#2 in AccountValue::AccountValue(Input const&) ihs_acctval.cpp:109
Fixed by moving the initialization. Resisted the temptation simply
to initialize it in the header, which would have left the defect
intact but restored its invisibility.
Although this defect was introduced 20050114T1947Z into CVS, it comes
from an original file predating the lmi epoch.
---
ihs_acctval.cpp | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/ihs_acctval.cpp b/ihs_acctval.cpp
index 0af0f8f1..2ca335da 100644
--- a/ihs_acctval.cpp
+++ b/ihs_acctval.cpp
@@ -422,11 +422,6 @@ void AccountValue::InitializeLife(mcenum_run_basis a_Basis)
LMI_ASSERT(11 == InvariantValues().MecMonth);
LMI_ASSERT(BasicValues::GetLength() == InvariantValues().MecYear );
- daily_interest_accounting = contains
- (yare_input_.Comments
- ,"idiosyncrasy_daily_interest_accounting"
- );
-
OldDBOpt = DeathBfts_->dbopt()[0];
// TAXATION !! 'OldSA' and 'OldDB' need to be distinguished for 7702 and
7702A,
// with inclusion of term dependent on 'TermIsDbFor7702' and
'TermIsDbFor7702A'.
@@ -611,6 +606,10 @@ void AccountValue::SetInitialValues()
Year = InforceYear;
Month = InforceMonth;
+ daily_interest_accounting = contains
+ (yare_input_.Comments
+ ,"idiosyncrasy_daily_interest_accounting"
+ );
CoordinateCounters();
DB7702A = C0; // TODO ?? TAXATION !! This seems silly.
- [lmi-commits] [lmi] master updated (60df9bef -> ae3e7881), Greg Chicares, 2022/06/10
- [lmi-commits] [lmi] master c77dfa03 01/13: Routinely make 'system_test' with UBSan, Greg Chicares, 2022/06/10
- [lmi-commits] [lmi] master 2ca30a6e 09/13: Specify $ASAN_OPTIONS in anticipation of using ASan, Greg Chicares, 2022/06/10
- [lmi-commits] [lmi] master 8fba89d4 11/13: Harden ELF linking, just because we can, Greg Chicares, 2022/06/10
- [lmi-commits] [lmi] master 8340ac54 04/13: Fix defect introduced 20050114T1947Z: use before initialization,
Greg Chicares <=
- [lmi-commits] [lmi] master 70d45fa9 12/13: Add many sanitizer options, Greg Chicares, 2022/06/10
- [lmi-commits] [lmi] master 49fbebcb 02/13: Record speed measurements, Greg Chicares, 2022/06/10
- [lmi-commits] [lmi] master ba44bdb9 07/13: Assume IEEE 754 division by zero where desirable, Greg Chicares, 2022/06/10
- [lmi-commits] [lmi] master 21263558 10/13: Ask gcc to comply with IEEE 754 more completely, Greg Chicares, 2022/06/10
- [lmi-commits] [lmi] master 7d702ce2 06/13: Replace std::vector with std::array, Greg Chicares, 2022/06/10
- [lmi-commits] [lmi] master ade6b59e 03/13: Fix defect introduced 20170221T0207Z: potential UB, Greg Chicares, 2022/06/10
- [lmi-commits] [lmi] master 4f2f4bf7 05/13: Avoid gratuitous UB, Greg Chicares, 2022/06/10
- [lmi-commits] [lmi] master eabe76c5 08/13: Specify $UBSAN_OPTIONS OAOO in script, Greg Chicares, 2022/06/10
- [lmi-commits] [lmi] master ae3e7881 13/13: Strengthen warnings, Greg Chicares, 2022/06/10