From 72ca2b214d4ffbaeed4840a806fb63740cf13c05 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 16 Feb 2018 15:22:29 -0500 Subject: ability to slice an undefined pointer at compile time if the len is 0 --- src/codegen.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/codegen.cpp') 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); -- cgit v1.2.3