aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-01-15 20:44:21 -0500
committerAndrew Kelley <superjoe30@gmail.com>2018-01-15 20:44:21 -0500
commit92fc5947fc18ea077f0e02bc4758e9050270e4bb (patch)
tree7f3967aa4372250330911b3b6d64ddb03bf05575 /src
parent5a4968484b1ff761766180204151e77a701cff68 (diff)
downloadzig-92fc5947fc18ea077f0e02bc4758e9050270e4bb.tar.gz
zig-92fc5947fc18ea077f0e02bc4758e9050270e4bb.zip
fix compiler crash related to @alignOf
Diffstat (limited to 'src')
-rw-r--r--src/analyze.cpp1
-rw-r--r--src/ir.cpp4
2 files changed, 3 insertions, 2 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index 8028ace289..9da8485014 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -2231,6 +2231,7 @@ static void resolve_union_zero_bits(CodeGen *g, TypeTableEntry *union_type) {
// is a pointer to this very struct, or a function pointer with parameters that
// reference such a type.
union_type->data.unionation.zero_bits_known = true;
+ union_type->data.unionation.zero_bits_loop_flag = false;
if (union_type->data.unionation.abi_alignment == 0) {
if (union_type->data.unionation.layout == ContainerLayoutPacked) {
union_type->data.unionation.abi_alignment = 1;
diff --git a/src/ir.cpp b/src/ir.cpp
index d6844f32ba..4dd022c09f 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -9858,7 +9858,7 @@ static TypeTableEntry *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCall *cal
if (fn_proto_node->data.fn_proto.is_var_args) {
ir_add_error(ira, &call_instruction->base,
- buf_sprintf("compiler bug: unable to call var args function at compile time. https://github.com/andrewrk/zig/issues/313"));
+ buf_sprintf("compiler bug: unable to call var args function at compile time. https://github.com/zig-lang/zig/issues/313"));
return ira->codegen->builtin_types.entry_invalid;
}
@@ -14011,7 +14011,7 @@ static TypeTableEntry *ir_analyze_instruction_align_of(IrAnalyze *ira, IrInstruc
return ira->codegen->builtin_types.entry_invalid;
TypeTableEntry *type_entry = ir_resolve_type(ira, type_value);
- ensure_complete_type(ira->codegen, type_entry);
+ type_ensure_zero_bits_known(ira->codegen, type_entry);
if (type_is_invalid(type_entry))
return ira->codegen->builtin_types.entry_invalid;