Ver código fonte

Fix make for dynamic arrays

Ginger Bill 8 anos atrás
pai
commit
01da0d1377
2 arquivos alterados com 2 adições e 2 exclusões
  1. 1 1
      core/os_windows.odin
  2. 1 1
      src/ir.c

+ 1 - 1
core/os_windows.odin

@@ -49,7 +49,7 @@ ERROR_FILE_IS_PIPE: Errno : 1<<29 + 0;
 
 
 // "Argv" arguments converted to Odin strings
-args := _alloc_command_line_arguments();
+immutable args := _alloc_command_line_arguments();
 
 
 open :: proc(path: string, mode: int, perm: u32) -> (Handle, Errno) {

+ 1 - 1
src/ir.c

@@ -3748,10 +3748,10 @@ irValue *ir_build_expr(irProcedure *proc, AstNode *expr) {
 					} else if (is_type_dynamic_array(type)) {
 						Type *elem_type = base_type(type)->DynamicArray.elem;
 						irValue *len = v_zero;
-						irValue *cap = ir_const_int(a, 8);
 						if (ce->args.count > 1) {
 							len = ir_emit_conv(proc, ir_build_expr(proc, ce->args.e[1]), t_int);
 						}
+						irValue *cap = len;
 						if (ce->args.count > 2) {
 							cap = ir_emit_conv(proc, ir_build_expr(proc, ce->args.e[2]), t_int);
 						}