Skip to content

Commit

Permalink
cgen: show the original malloc call on a detected leak
Browse files Browse the repository at this point in the history
  • Loading branch information
spytheman committed Mar 25, 2021
1 parent 1bf7d96 commit f29ca6b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vlib/v/gen/c/fn.v
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ fn (mut g Gen) process_fn_decl(node ast.FnDecl) {
if !g.is_used_by_main(node) {
return
}
if g.is_builtin_mod && g.pref.gc_mode == .boehm_leak && node.name == 'malloc' {
g.definitions.write_string('#define v_malloc GC_MALLOC\n')
return
}
g.gen_attrs(node.attrs)
// g.tmp_count = 0 TODO
mut skip := false
Expand Down

0 comments on commit f29ca6b

Please sign in to comment.