From 51542b279fcae0f740a76b631ce0fbcdf4c7cf5e Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Fri, 21 Jan 2011 08:25:13 -0800 Subject: [PATCH] Fix bug in trans_for, un-XFAIL linear-for-loop.rs. --- src/Makefile | 1 + src/comp/middle/trans.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 0e039d657e1..4f27b434abf 100644 --- a/src/Makefile +++ b/src/Makefile @@ -456,6 +456,7 @@ TEST_XFAILS_RUSTC := $(filter-out \ large-records.rs \ lazy-init.rs \ lazy-and-or.rs \ + linear-for-loop.rs \ multiline-comment.rs \ obj-drop.rs \ obj-recursion.rs \ diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index 1a703d0a25b..57f5b002b65 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -1808,7 +1808,7 @@ fn trans_for(@block_ctxt cx, cx.build.Br(scope_cx.llbb); auto local_res = alloc_local(scope_cx, local); auto bcx = copy_ty(local_res.bcx, true, local_res.val, curr, t).bcx; - trans_block(bcx, body); + bcx = trans_block(bcx, body).bcx; bcx.build.Br(next_cx.llbb); ret res(next_cx, C_nil()); }