From 3d2752cc3677535ddfbeeefba4036633bcab01dc Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 24 Nov 2018 16:15:58 -0500 Subject: refactor type_requires_comptime to have possible error fixes a compiler crash when building https://github.com/AndreaOrru/zen --- src/codegen.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/codegen.cpp') diff --git a/src/codegen.cpp b/src/codegen.cpp index 096552037d..37e0424961 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -6281,8 +6281,14 @@ static void do_code_gen(CodeGen *g) { } if (ir_get_var_is_comptime(var)) continue; - if (type_requires_comptime(var->value->type)) - continue; + switch (type_requires_comptime(g, var->value->type)) { + case ReqCompTimeInvalid: + zig_unreachable(); + case ReqCompTimeYes: + continue; + case ReqCompTimeNo: + break; + } if (var->src_arg_index == SIZE_MAX) { var->value_ref = build_alloca(g, var->value->type, buf_ptr(&var->name), var->align_bytes); -- cgit v1.2.3