Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RCORE-2153: Fix issue when clearing a Lst<Mixed> in an upgraded file #7806

Merged
merged 2 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* <How do the end-user experience this issue? what was the impact?> ([#????](https://github.com/realm/realm-core/issues/????), since v?.?.?)
* Valgrind could report a branch on an uninitialized read when opening something that is not an encrypted Realm file as an encrypted Realm file ([PR #7789](https://github.com/realm/realm-core/pull/7789), since v14.10.0).
* Opening an FLX realm asynchronously may not wait to download all data ([#7720](https://github.com/realm/realm-core/issues/7720), since FLX sync was introduced).
* Clearing a List of Mixed in an upgraded file would lead to an assertion failing ([#7771](https://github.com/realm/realm-core/issues/7771), since 14.0.0)
* Fix compilation with Xcode 16 ([PR #7802](https://github.com/realm/realm-core/pull/7802))

### Breaking changes
Expand Down
4 changes: 3 additions & 1 deletion src/realm/array_mixed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ void ArrayMixed::clear()
Array::set(payload_idx_int, 0);
Array::set(payload_idx_pair, 0);
Array::set(payload_idx_str, 0);
Array::set(payload_idx_ref, 0);
if (Array::size() > payload_idx_ref) {
Array::set(payload_idx_ref, 0);
}
if (Array::size() > payload_idx_key) {
if (auto ref = Array::get_as_ref(payload_idx_key)) {
Array::destroy(ref, m_composite.get_alloc());
Expand Down
Loading