From dd12a85429220934b69fecc1e48e63875be7fae0 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sat, 26 Oct 2019 22:26:30 +0300 Subject: [PATCH] array: fix a regression --- vlib/compiler/gen_c.v | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vlib/compiler/gen_c.v b/vlib/compiler/gen_c.v index 03554b7efc..b1e9dd9b55 100644 --- a/vlib/compiler/gen_c.v +++ b/vlib/compiler/gen_c.v @@ -195,12 +195,12 @@ fn (p mut Parser) index_get(typ string, fn_ph int, cfg IndexConfig) { p.gen('$index_expr ]') } else { - amp := if cfg.is_ptr { '&' } else { '' } + ref := if cfg.is_ptr { '*' } else { '' } if cfg.is_slice { - p.gen(' array_slice($amp $index_expr) ') + p.gen(' array_slice($ref $index_expr) ') } else { - p.gen('( *($typ*) array_get($amp $index_expr) )') + p.gen('( *($typ*) array_get($ref $index_expr) )') } } }