aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2018-11-01 16:53:06 +0100
committerSverker Eriksson <[email protected]>2018-11-01 17:48:20 +0100
commite5b006ce3361467f77c372a4b6f19f9e0d9ddf23 (patch)
tree62b1b9d5c3d9aeb76b8f876b2a3b284f4c59cebe /erts
parentcc18836780d7d047bf53b1ff8d94a6b31b58f98a (diff)
downloadotp-e5b006ce3361467f77c372a4b6f19f9e0d9ddf23.tar.gz
otp-e5b006ce3361467f77c372a4b6f19f9e0d9ddf23.tar.bz2
otp-e5b006ce3361467f77c372a4b6f19f9e0d9ddf23.zip
erts: Fix bug for catree iteration
with keys containing off-heap terms. The passed key may actually be the one already saved (if nodes have been joined), in which case we do nothing. Calling destroy_route_key() may destroy off-heap data.
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/beam/erl_db_catree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_db_catree.c b/erts/emulator/beam/erl_db_catree.c
index b52a4a53fe..7a5587f1fd 100644
--- a/erts/emulator/beam/erl_db_catree.c
+++ b/erts/emulator/beam/erl_db_catree.c
@@ -1585,7 +1585,8 @@ static Eterm copy_iter_search_key(CATreeRootIterator* iter, Eterm key)
return key;
if (iter->search_key) {
- ASSERT(key != iter->search_key->term);
+ if (key == iter->search_key->term)
+ return key; /* already saved */
destroy_route_key(iter->search_key);
}
key_size = size_object(key);