From f2b1a8cb16898a1e0ce7063c2cd86edc4d0bdb36 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Mon, 11 Nov 2019 07:09:07 +0300 Subject: [PATCH] fix option_test.v --- vlib/compiler/gen_c.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/compiler/gen_c.v b/vlib/compiler/gen_c.v index 98659a8100..654bda8cb6 100644 --- a/vlib/compiler/gen_c.v +++ b/vlib/compiler/gen_c.v @@ -126,9 +126,9 @@ fn (p mut Parser) gen_handle_option_or_else(_typ, name string, fn_call_ph int) s last_ph := p.cgen.add_placeholder() last_typ := p.statements() if is_assign && last_typ == typ { - expr_line := p.cgen.lines[p.cgen.lines.len-3] + expr_line := p.cgen.lines[p.cgen.lines.len-2] last_expr := expr_line[last_ph..] - p.cgen.lines[p.cgen.lines.len-3] = '' + p.cgen.lines[p.cgen.lines.len-2] = '' p.genln('if (!$tmp .ok) {') p.genln('$name = $last_expr;') p.genln('}')