diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-08-19 14:46:12 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-08-19 14:46:12 -0400 |
| commit | 44fb5275c1babed97a38b4b3c97e59740a2a5cc5 (patch) | |
| tree | 421673b24e4605ce0fc8290c1248ebffc4364728 /src/ir.cpp | |
| parent | 3f7f52003690ccee8a2a33e91258428e22761492 (diff) | |
| download | zig-44fb5275c1babed97a38b4b3c97e59740a2a5cc5.tar.gz zig-44fb5275c1babed97a38b4b3c97e59740a2a5cc5.zip | |
fix array multiplication not setting parent value info
closes #3095
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 65a66c8416..3b855b374f 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -13963,8 +13963,11 @@ static IrInstruction *ir_analyze_array_mult(IrAnalyze *ira, IrInstructionBinOp * uint64_t i = 0; for (uint64_t x = 0; x < mult_amt; x += 1) { for (uint64_t y = 0; y < old_array_len; y += 1) { - copy_const_val(&out_val->data.x_array.data.s_none.elements[i], - &array_val->data.x_array.data.s_none.elements[y], false); + ConstExprValue *elem_dest_val = &out_val->data.x_array.data.s_none.elements[i]; + copy_const_val(elem_dest_val, &array_val->data.x_array.data.s_none.elements[y], false); + elem_dest_val->parent.id = ConstParentIdArray; + elem_dest_val->parent.data.p_array.array_val = out_val; + elem_dest_val->parent.data.p_array.elem_index = i; i += 1; } } |
