Skip to content

Commit

Permalink
v.debug: fix code generated for stringfy ptr with non-pointer str() (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Feb 2, 2024
1 parent e9320ad commit 5f732aa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vlib/v/gen/c/cgen.v
Expand Up @@ -4021,6 +4021,8 @@ fn (mut g Gen) debugger_stmt(node ast.DebuggerStmt) {
''
} else if str_method_expects_ptr && !obj.typ.is_ptr() {
'&'
} else if !str_method_expects_ptr && obj.typ.is_ptr() {
'*'.repeat(obj.typ.nr_muls())
} else if obj.is_auto_heap && var_typ.is_ptr() && str_method_expects_ptr {
'*'
} else if !obj.is_auto_heap && var_typ.is_ptr() && str_method_expects_ptr {
Expand Down

0 comments on commit 5f732aa

Please sign in to comment.