Skip to content

Commit

Permalink
Don't descend into functions from relax_precond_block
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Sep 28, 2011
1 parent 759fc10 commit a3a2737
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/comp/middle/trans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4091,7 +4091,7 @@ fn trans_rec(bcx: @block_ctxt, fields: [ast::field],
for tf in ty_fields {
let dst = GEP_tup_like_1(bcx, t, addr, [0, i]);
bcx = dst.bcx;
// FIXME make this {|f| str::eq(f.node.ident, tf.ident)} again when
// FIXME make this again when
// bug #913 is fixed
fn test(n: str, f: ast::field) -> bool { str::eq(f.node.ident, n) }
alt vec::find(bind test(tf.ident, _), fields) {
Expand Down
3 changes: 2 additions & 1 deletion src/comp/middle/tstate/bitvectors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ fn relax_precond_block(fcx: fn_ctxt, i: node_id, b: blk) {
visit_expr: relax_precond_expr,
visit_stmt: relax_precond_stmt,
visit_item:
fn (_i: @item, _cx: relax_ctxt, _vt: visit::vt<relax_ctxt>) { }
fn (_i: @item, _cx: relax_ctxt, _vt: visit::vt<relax_ctxt>) { },
visit_fn: do_nothing
with *visitor};
let v1 = visit::mk_vt(visitor);
v1.visit_block(b, cx, v1);
Expand Down
13 changes: 4 additions & 9 deletions src/comp/middle/tstate/collect_locals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,14 @@ fn mk_fn_info(ccx: crate_ctxt, f: _fn, tp: [ty_param], f_sp: span,
// "diverges" constraint
let diverges_id = ccx.tcx.sess.next_node_id();
let diverges_name = name + "!";
add_constraint(cx.tcx, respan(f_sp, ninit(diverges_id, diverges_name)),
next, res_map);
next = add_constraint(cx.tcx, respan(f_sp, ninit(diverges_id,
diverges_name)),
next, res_map);

let v: @mutable [node_id] = @mutable [];
let rslt =
{constrs: res_map,

// add 2 to account for the i_return and i_diverge constraints
// FIXME the 1u here is a kludge to make bug #913's impact somewhat
// smaller. it should be removed once the bug is really fixed
num_constraints:
vec::len(*cx.cs) + vec::len(f.decl.constraints) +
vec::len(f.decl.inputs) + 2u + 1u,
num_constraints: next,
cf: f.decl.cf,
i_return: ninit(id, name),
i_diverge: ninit(diverges_id, diverges_name),
Expand Down

0 comments on commit a3a2737

Please sign in to comment.