Skip to content

Commit 7f97eac

Browse files
nathaniel.volfangojenkins
authored andcommitted
QPR-12377 -- Fix boost assertion error from accessing underlying before building
1 parent 4e4c11f commit 7f97eac

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

OREData/ored/portfolio/trs.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,6 @@ void TRS::build(const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory) {
301301
creditQualifierMapping_.clear();
302302
notionalCurrency_ = returnData_.currency();
303303

304-
// propagate additional data from underlyings to trs trade
305-
for (Size i = 0; i < underlying_.size(); ++i) {
306-
for (auto const& [key, value] : underlying_[i]->additionalData()) {
307-
additionalData_["und_ad_" + std::to_string(i + 1) + "_" + key] = value;
308-
}
309-
}
310-
311304
// checks
312305

313306
std::set<bool> fundingLegPayers;
@@ -349,6 +342,13 @@ void TRS::build(const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory) {
349342
}
350343
}
351344

345+
// propagate additional data from underlyings to trs trade
346+
for (Size i = 0; i < underlying_.size(); ++i) {
347+
for (auto const& [key, value] : underlying_[i]->additionalData()) {
348+
additionalData_["und_ad_" + std::to_string(i + 1) + "_" + key] = value;
349+
}
350+
}
351+
352352
// we use dirty prices, so we need accrued amounts in the past
353353
requiredFixings_.unsetPayDates();
354354

0 commit comments

Comments
 (0)