diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-02-25 20:28:44 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-02-25 20:28:44 -0500 |
| commit | 6b436146a8065b3e19c11359df85a44dac269730 (patch) | |
| tree | ca8af3aa1b669886121931b0b426ff1068e64ae5 /src/ir.cpp | |
| parent | 6cbea99ed6c0a87b4e4b779975f7f26738241280 (diff) | |
| download | zig-6b436146a8065b3e19c11359df85a44dac269730.tar.gz zig-6b436146a8065b3e19c11359df85a44dac269730.zip | |
fix invalid memory write in coroutines implementation
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index b3f53f824d..5c5bfc3cd1 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -942,7 +942,7 @@ static IrInstruction *ir_build_const_promise_init(IrBuilder *irb, Scope *scope, IrInstructionConst *const_instruction = ir_build_instruction<IrInstructionConst>(irb, scope, source_node); const_instruction->base.value.type = struct_type; const_instruction->base.value.special = ConstValSpecialStatic; - const_instruction->base.value.data.x_struct.fields = allocate<ConstExprValue>(2); + const_instruction->base.value.data.x_struct.fields = allocate<ConstExprValue>(field_count); const_instruction->base.value.data.x_struct.fields[0].type = awaiter_handle_type; const_instruction->base.value.data.x_struct.fields[0].special = ConstValSpecialStatic; const_instruction->base.value.data.x_struct.fields[0].data.x_maybe = nullptr; |
