aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-09-21 23:47:33 +0100
committergingerBill <bill@gingerbill.org>2022-09-21 23:47:33 +0100
commit0380601bb489d6488bbc0a3322a06889dca9bd02 (patch)
tree6ec902e4b4e0039efd4ea1d320cbae1c5a6d08b3 /core
parenta6d3cbe824b3ab6849af3f1c4abb94d7a72ed801 (diff)
Fix `map_insert`
Diffstat (limited to 'core')
-rw-r--r--core/runtime/core_builtin.odin6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/runtime/core_builtin.odin b/core/runtime/core_builtin.odin
index 568deed3b..574023a1e 100644
--- a/core/runtime/core_builtin.odin
+++ b/core/runtime/core_builtin.odin
@@ -672,10 +672,10 @@ shrink_dynamic_array :: proc(array: ^$T/[dynamic]$E, new_cap := -1, loc := #call
@builtin
map_insert :: proc(m: ^$T/map[$K]$V, key: K, value: V, loc := #caller_location) -> (ptr: ^V) {
key, value := key, value
- h := __get_map_header(m)
+ h := __get_map_header(T)
- data := uintptr(__dynamic_map_set(h, __get_map_key_hash(&key), &key, &value, loc))
- return (^V)(data + h.value_offset)
+ e := __dynamic_map_set(m, h, __get_map_key_hash(&key), &key, &value, loc)
+ return (^V)(uintptr(e) + h.value_offset)
}