Skip to content

Commit 302cebc

Browse files
committed
---
yaml --- r: 4275 b: refs/heads/master c: 6a4d0ce h: refs/heads/master i: 4273: 46f4084 4271: f587b0a v: v3
1 parent 8a0b16a commit 302cebc

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
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: 7efbad674ab1cdec36af3143d7b64baa5133b067
2+
refs/heads/master: 6a4d0ce829d999900199c6af53592537727ea5e9

trunk/src/comp/middle/tstate/auxiliary.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,9 @@ fn node_id_to_def_strict(cx: &ty::ctxt, id: node_id) -> def {
510510
fn node_id_to_def(ccx: &crate_ctxt, id: node_id) -> option::t[def] {
511511
ret ccx.tcx.def_map.find(id);
512512
}
513+
fn node_id_to_def_upvar(cx: &fn_ctxt, id: node_id) -> option::t[def] {
514+
ret freevars::def_lookup(cx.ccx.tcx, cx.id, id);
515+
}
513516

514517
fn norm_a_constraint(id: def_id, c: &constraint) -> norm_constraint[] {
515518
alt c {

trunk/src/comp/middle/tstate/pre_post_conditions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ fn join_then_else(fcx: &fn_ctxt, antec: &@expr, conseq: &blk,
218218
219219
fn gen_if_local(fcx: &fn_ctxt, lhs: @expr, rhs: @expr, larger_id: node_id,
220220
new_var: node_id, pth: &path) {
221-
alt node_id_to_def(fcx.ccx, new_var) {
221+
alt node_id_to_def_upvar(fcx, new_var) {
222222
some(d) {
223223
alt d {
224224
def_local(d_id) {
@@ -257,7 +257,7 @@ fn handle_update(fcx: &fn_ctxt, parent: &@expr, lhs: &@expr, rhs: &@expr,
257257
}
258258
_ {
259259
// pure and assign_op require the lhs to be init'd
260-
let df = node_id_to_def_strict(fcx.ccx.tcx, lhs.id);
260+
let df = node_id_to_def_upvar_strict(fcx, lhs.id);
261261
alt df {
262262
def_local(d_id) {
263263
let i =

0 commit comments

Comments
 (0)