From 5d1fb6752187efa90ed8ab6685b28990f099f1d9 Mon Sep 17 00:00:00 2001 From: Bruce Collie Date: Tue, 5 Dec 2023 15:52:43 +0000 Subject: [PATCH] Add user map element symbol --- runtime/collections/maps.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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(); }