Skip to content

Commit 74711e3

Browse files
committed
---
yaml --- r: 662 b: refs/heads/master c: bc646d0 h: refs/heads/master v: v3
1 parent c483784 commit 74711e3

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 67aa39e1ef4358c309f4b07f1d587a0dad6dddf8
2+
refs/heads/master: bc646d01c501f2566fd78057e23c283cfedc0eb0

trunk/src/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,7 @@ TEST_XFAILS_LLVM := $(TASK_XFAILS) \
533533
str-concat.rs \
534534
str-idx.rs \
535535
tag.rs \
536+
tail-call-arg-leak.rs \
536537
tail-cps.rs \
537538
tail-direct.rs \
538539
task-comm.rs \

trunk/src/boot/me/trans.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4219,6 +4219,8 @@ let trans_visitor
42194219
(Printf.sprintf "copy args for tail call to %s" (logname ())));
42204220
copy_fn_args true true CLONE_none call;
42214221
drop_slots_at_curr_stmt();
4222+
iflog (fun _ -> annotate "drop args");
4223+
iter_arg_slots cx (current_fn()) callee_drop_slot;
42224224
abi.Abi.abi_emit_fn_tail_call (emitter())
42234225
(force_sz (current_fn_callsz()))
42244226
caller_argsz callee_code callee_argsz;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// use of tail calls causes arg slot leaks, issue #160.
2+
3+
fn inner(str dummy, bool b) {
4+
if (b) {
5+
be inner(dummy, false);
6+
}
7+
}
8+
9+
fn main() {
10+
inner("hi", true);
11+
}

0 commit comments

Comments
 (0)