Skip to content

Commit 367cdba

Browse files
authored
Merge pull request #2713 from stratakis/use_after_move
mip: Fix use-after-move in HighsLpRelaxation::loadModel
2 parents 96f998e + eedc74e commit 367cdba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

highs/mip/HighsLpRelaxation.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,12 @@ void HighsLpRelaxation::loadModel() {
237237
for (HighsInt i = 0; i != lpmodel.num_row_; ++i)
238238
lprows.push_back(LpRow::model(i));
239239
lpmodel.integrality_.clear();
240+
HighsInt num_col = lpmodel.num_col_;
240241
lpsolver.clearSolver();
241242
lpsolver.clearModel();
242243
lpsolver.passModel(std::move(lpmodel));
243-
colLbBuffer.resize(lpmodel.num_col_);
244-
colUbBuffer.resize(lpmodel.num_col_);
244+
colLbBuffer.resize(num_col);
245+
colUbBuffer.resize(num_col);
245246
}
246247

247248
void HighsLpRelaxation::resetToGlobalDomain() {

0 commit comments

Comments
 (0)