From ee66c72a61fa55310cf8fe8e1b0ead03f8537f66 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Wed, 22 Jan 2025 19:19:07 -0300 Subject: [PATCH] fix --- vlib/v/gen/c/auto_str_methods.v | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vlib/v/gen/c/auto_str_methods.v b/vlib/v/gen/c/auto_str_methods.v index 8a25ce27e6a123..89ac948c558f68 100644 --- a/vlib/v/gen/c/auto_str_methods.v +++ b/vlib/v/gen/c/auto_str_methods.v @@ -203,7 +203,8 @@ fn (mut g Gen) gen_str_for_option(typ ast.Type, styp string, str_fn_name string) g.auto_str_funcs.writeln('\tstring res;') g.auto_str_funcs.writeln('\tif (it.state == 0) {') deref := if typ.is_ptr() { - '**(${sym.cname}**)&' + dot := if expects_ptr { '*'.repeat(typ.nr_muls()) } else { '*'.repeat(typ.nr_muls() + 1) } + '${dot}(${sym.cname}**)&' } else if expects_ptr { '(${sym.cname}*)' } else {