Skip to content

Commit 857ad58

Browse files
committed
Fix double-cleanup bug in patch 57c7645
Things would run fine (probably by sheer luck) but valgrind didn't approve.
1 parent 90324a1 commit 857ad58

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/comp/middle/trans/base.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3302,9 +3302,11 @@ fn trans_expr(bcx: @block_ctxt, e: @ast::expr, dest: dest) -> @block_ctxt {
33023302
ast::expr_call(f, args, _) {
33033303
ret trans_call(bcx, f, args, e.id, dest);
33043304
}
3305-
ast::expr_field(_, _, _) {
3305+
ast::expr_field(base, _, _) {
3306+
if dest == ignore { ret trans_expr(bcx, base, ignore); }
33063307
let callee = trans_callee(bcx, e), ty = expr_ty(bcx, e);
33073308
let lv = lval_maybe_callee_to_lval(callee, ty);
3309+
revoke_clean(lv.bcx, lv.val);
33083310
ret memmove_ty(lv.bcx, get_dest_addr(dest), lv.val, ty);
33093311
}
33103312
ast::expr_index(base, idx) {

0 commit comments

Comments
 (0)