authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-02-25 20:28:44-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-02-25 20:28:44-05:00
log6b436146a8065b3e19c11359df85a44dac269730
treeca8af3aa1b669886121931b0b426ff1068e64ae5
parent6cbea99ed6c0a87b4e4b779975f7f26738241280

fix invalid memory write in coroutines implementation


1 files changed, 1 insertions(+), 1 deletions(-)

src/ir.cpp+1-1
......@@ -942,7 +942,7 @@ static IrInstruction *ir_build_const_promise_init(IrBuilder *irb, Scope *scope,
942942 IrInstructionConst *const_instruction = ir_build_instruction<IrInstructionConst>(irb, scope, source_node);
943943 const_instruction->base.value.type = struct_type;
944944 const_instruction->base.value.special = ConstValSpecialStatic;
945 const_instruction->base.value.data.x_struct.fields = allocate<ConstExprValue>(2);
945 const_instruction->base.value.data.x_struct.fields = allocate<ConstExprValue>(field_count);
946946 const_instruction->base.value.data.x_struct.fields[0].type = awaiter_handle_type;
947947 const_instruction->base.value.data.x_struct.fields[0].special = ConstValSpecialStatic;
948948 const_instruction->base.value.data.x_struct.fields[0].data.x_maybe = nullptr;