rustc: Don't recurse in seq_preconds. Consumes too much stack
This commit is contained in:
parent
afca68b820
commit
3f283bb168
@ -82,6 +82,9 @@ fn seq_preconds(fcx: fn_ctxt, pps: [pre_and_post]) -> precond {
|
||||
|
||||
fn seq_preconds_go(fcx: fn_ctxt, pps: [pre_and_post], first: pre_and_post)
|
||||
-> precond {
|
||||
let mut pps = pps;
|
||||
let mut first = first;
|
||||
loop {
|
||||
let sz: uint = vec::len(pps);
|
||||
if sz >= 1u {
|
||||
let second = pps[0];
|
||||
@ -92,12 +95,12 @@ fn seq_preconds(fcx: fn_ctxt, pps: [pre_and_post]) -> precond {
|
||||
union(next_first, second_pre);
|
||||
let next_first_post = clone(first.postcondition);
|
||||
seq_tritv(next_first_post, second.postcondition);
|
||||
ret seq_preconds_go(fcx, vec::slice(pps, 1u, sz),
|
||||
@{precondition: next_first,
|
||||
postcondition: next_first_post});
|
||||
pps = vec::slice(pps, 1u, sz);
|
||||
first = @{precondition: next_first,
|
||||
postcondition: next_first_post};
|
||||
} else { ret first.precondition; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if sz >= 1u {
|
||||
let first = pps[0];
|
||||
|
2002
src/test/run-pass/deep-vector.rs
Normal file
2002
src/test/run-pass/deep-vector.rs
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user