diff --git a/runtime/collections/maps.cpp b/runtime/collections/maps.cpp index 98701d3c9..10e6b191b 100644 --- a/runtime/collections/maps.cpp +++ b/runtime/collections/maps.cpp @@ -18,6 +18,20 @@ map hook_MAP_element(SortKItem key, SortKItem value) { return map().set(key, value); } +map hook_MAP_user_element(block *key, block *value) { + std::string key_sort = getReturnSortForTag(tag(key)); + if (key_sort != "SortKItem{}") { + key = constructKItemInj(key, key_sort.c_str(), false); + } + + std::string val_sort = getReturnSortForTag(tag(value)); + if (val_sort != "SortKItem{}") { + value = constructKItemInj(value, val_sort.c_str(), false); + } + + return map().set(key, value); +} + map hook_MAP_unit() { return map(); }