aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-02-16 15:22:29 -0500
committerAndrew Kelley <superjoe30@gmail.com>2018-02-16 15:22:29 -0500
commit72ca2b214d4ffbaeed4840a806fb63740cf13c05 (patch)
tree798850ee35ed9e6943aa1eb01a283137d16b6702 /src/codegen.cpp
parentcbbd6cfa1e85dc5cda38572f7a1d462a678c2adf (diff)
downloadzig-72ca2b214d4ffbaeed4840a806fb63740cf13c05.tar.gz
zig-72ca2b214d4ffbaeed4840a806fb63740cf13c05.zip
ability to slice an undefined pointer at compile time if the len is 0
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 00103be259..15648cbdec 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -4201,6 +4201,7 @@ static LLVMValueRef gen_const_val(CodeGen *g, ConstExprValue *const_val, const c
continue;
}
ConstExprValue *field_val = &const_val->data.x_struct.fields[i];
+ assert(field_val->type != nullptr);
LLVMValueRef val = gen_const_val(g, field_val, "");
fields[type_struct_field->gen_index] = val;
make_unnamed_struct = make_unnamed_struct || is_llvm_value_unnamed_type(field_val->type, val);