diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-12-26 16:04:14 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-12-26 16:04:14 -0500 |
| commit | c8a7ab7eff0f261c47926cf0637e919d42e41940 (patch) | |
| tree | e06648c3784b8fdfcd626b34956565fccc5d7454 /src/ir.cpp | |
| parent | 7504be923b1721a5a5e094a306aad029887270e8 (diff) | |
| download | zig-c8a7ab7eff0f261c47926cf0637e919d42e41940.tar.gz zig-c8a7ab7eff0f261c47926cf0637e919d42e41940.zip | |
IR: pass cStringConcatenation test
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 7eac05def6..c964f5536b 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -6173,8 +6173,9 @@ static TypeTableEntry *ir_analyze_array_cat(IrAnalyze *ira, IrInstructionBinOp * TypeTableEntry *result_type; ConstExprValue *out_array_val; size_t new_len = (op1_array_end - op1_array_index) + (op2_array_end - op2_array_index); + TypeTableEntry *out_array_type = get_array_type(ira->codegen, child_type, new_len); if (op1_canon_type->id == TypeTableEntryIdArray || op2_canon_type->id == TypeTableEntryIdArray) { - result_type = get_array_type(ira->codegen, child_type, new_len); + result_type = out_array_type; out_array_val = out_val; } else { @@ -6182,7 +6183,7 @@ static TypeTableEntry *ir_analyze_array_cat(IrAnalyze *ira, IrInstructionBinOp * out_array_val = allocate<ConstExprValue>(1); out_array_val->special = ConstValSpecialStatic; - out_array_val->type = result_type; + out_array_val->type = out_array_type; out_val->data.x_ptr.base_ptr = out_array_val; out_val->data.x_ptr.index = 0; out_val->data.x_ptr.special = ConstPtrSpecialCStr; |
