Browse Source

Correct `fmt` printing to be robust

gingerBill 2 years ago
parent
commit
2c3febd620
1 changed files with 2 additions and 2 deletions
  1. 2 2
      core/fmt/fmt.odin

+ 2 - 2
core/fmt/fmt.odin

@@ -2085,8 +2085,8 @@ fmt_value :: proc(fi: ^Info, v: any, verb: rune) {
 				}
 				j += 1
 
-				key   := ks + bucket_index*uintptr(info.key.size)
-				value := vs + bucket_index*uintptr(info.value.size)
+				key   := runtime.map_cell_index_dynamic(ks, &info.map_info.ks, bucket_index)
+				value := runtime.map_cell_index_dynamic(vs, &info.map_info.vs, bucket_index)
 
 				fmt_arg(&Info{writer = fi.writer}, any{rawptr(key), info.key.id}, 'v')
 				io.write_string(fi.writer, "=", &fi.n)