Skip to content

Commit d2a1410

Browse files
committed
Fix 32bit overflow
1 parent 014c8d2 commit d2a1410

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/sparse/fronts/FrontBLR.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ namespace strumpack {
409409
A.extract_front
410410
(F11, F12, F21, sep_begin_, sep_end_, this->upd_, task_depth);
411411
if (dupd) {
412-
CBstorage_ = workspace.get(dupd*dupd);
412+
CBstorage_ = workspace.get(std::size_t(dupd)*dupd);
413413
F22_ = DenseMW_t(dupd, dupd, CBstorage_.data(), dupd);
414414
F22_.zero();
415415
}

src/sparse/fronts/FrontDense.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,7 @@ namespace strumpack {
237237
(F11_, F12_, F21_, this->sep_begin_, this->sep_end_,
238238
this->upd_, task_depth);
239239
if (dupd) {
240-
CBstorage_ = workspace.get();
241-
integer_t old_size = CBstorage_.size();
242-
if (dupd*dupd > old_size) {
243-
STRUMPACK_ADD_MEMORY((dupd*dupd - old_size)*sizeof(scalar_t));
244-
}
245-
CBstorage_.resize(dupd*dupd);
240+
CBstorage_ = workspace.get(std::size_t(dupd)*dupd);
246241
F22_ = DenseMW_t(dupd, dupd, CBstorage_.data(), dupd);
247242
F22_.zero();
248243
}

0 commit comments

Comments
 (0)