aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorxackus <14938807+xackus@users.noreply.github.com>2020-06-20 18:35:01 +0200
committerAndrew Kelley <andrew@ziglang.org>2020-06-21 14:57:12 -0400
commitd907f574e02aadf8196e616bcc2fb2813cf2c82c (patch)
treeafd234afad685c9498582e90329cda004fb6e6a8 /src/ir.cpp
parent8696e52a3d617ce30ec6202adc89cb10c67bcc43 (diff)
downloadzig-d907f574e02aadf8196e616bcc2fb2813cf2c82c.tar.gz
zig-d907f574e02aadf8196e616bcc2fb2813cf2c82c.zip
stage1: fix concat of sliced str literals
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index bb6ca554df..3fa138ed8e 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -826,12 +826,11 @@ static ZigValue *const_ptr_pointee_unchecked_no_isf(CodeGen *g, ZigValue *const_
ZigValue *array_val = const_val->data.x_ptr.data.base_array.array_val;
size_t elem_index = const_val->data.x_ptr.data.base_array.elem_index;
- // TODO handle sentinel terminated arrays
expand_undef_array(g, array_val);
result = g->pass1_arena->create<ZigValue>();
result->special = array_val->special;
result->type = get_array_type(g, array_val->type->data.array.child_type,
- array_val->type->data.array.len - elem_index, nullptr);
+ array_val->type->data.array.len - elem_index, array_val->type->data.array.sentinel);
result->data.x_array.special = ConstArraySpecialNone;
result->data.x_array.data.s_none.elements = &array_val->data.x_array.data.s_none.elements[elem_index];
result->parent.id = ConstParentIdArray;