zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 5ec6a0ea028cd26e9042d4d7a944d5b085f921a4 (tree)
parent fae6cf09619e7a8e64f61b84cca7d9fcd471262f
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Wed, 25 Mar 2020 21:00:02 -0400

fix an invalid free having to do with bound functions

this should fix the drone CI failure

Diffstat:
Msrc/ir.cpp | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/ir.cpp b/src/ir.cpp @@ -13028,6 +13028,9 @@ static IrInstGen *ir_const_fn(IrAnalyze *ira, IrInst *source_instr, ZigFn *fn_en static IrInstGen *ir_const_bound_fn(IrAnalyze *ira, IrInst *src_inst, ZigFn *fn_entry, IrInstGen *first_arg, IrInst *first_arg_src) { + // This is unfortunately required to avoid improperly freeing first_arg_src + ira_ref(ira); + IrInstGen *result = ir_const(ira, src_inst, get_bound_fn_type(ira->codegen, fn_entry)); result->value->data.x_bound_fn.fn = fn_entry; result->value->data.x_bound_fn.first_arg = first_arg;