Merge pull request #5264 from akva2/fix_oob_no_wells

fixed: out-of-bounds reference with no wells
This commit is contained in:
Markus Blatt
2024-04-02 10:48:26 +02:00
committed by GitHub

View File

@@ -863,7 +863,9 @@ void WellState::communicateGroupRates(const Comm& comm)
data[pos++] = 0; data[pos++] = 0;
} }
} }
pos += this->alq_state.pack_data(&data[pos]); if (!data.empty()) {
pos += this->alq_state.pack_data(&data[pos]);
}
assert(pos == sz); assert(pos == sz);
// Communicate it with a single sum() call. // Communicate it with a single sum() call.
@@ -877,7 +879,9 @@ void WellState::communicateGroupRates(const Comm& comm)
for (auto& value : rates) for (auto& value : rates)
value = data[pos++]; value = data[pos++];
} }
pos += this->alq_state.unpack_data(&data[pos]); if (!data.empty()) {
pos += this->alq_state.unpack_data(&data[pos]);
}
assert(pos == sz); assert(pos == sz);
} }