Browse Source

Fix `for in` for `map`

gingerBill 2 years ago
parent
commit
0819d05a0b
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/llvm_backend_stmt.cpp

+ 2 - 2
src/llvm_backend_stmt.cpp

@@ -461,8 +461,8 @@ void lb_build_range_map(lbProcedure *p, lbValue expr, Type *val_type,
 	idx = lb_addr_load(p, index);
 	idx = lb_addr_load(p, index);
 
 
 	lbValue ks = lb_map_data_uintptr(p, map_value);
 	lbValue ks = lb_map_data_uintptr(p, map_value);
-	lbValue vs = lb_map_cell_index_static(p, type->Map.key, ks, capacity);
-	lbValue hs = lb_map_cell_index_static(p, type->Map.value, vs, capacity);
+	lbValue vs = lb_emit_conv(p, lb_map_cell_index_static(p, type->Map.key, ks, capacity), alloc_type_pointer(type->Map.value));
+	lbValue hs = lb_emit_conv(p, lb_map_cell_index_static(p, type->Map.value, vs, capacity), alloc_type_pointer(t_uintptr));
 
 
 	// NOTE(bill): no need to use lb_map_cell_index_static for that hashes
 	// NOTE(bill): no need to use lb_map_cell_index_static for that hashes
 	// since it will always be packed without padding into the cells
 	// since it will always be packed without padding into the cells