about summary refs log tree commit diff
path: root/src/comp
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2011-04-27 14:55:55 -0700
committerGraydon Hoare <graydon@mozilla.com>2011-04-28 13:26:19 -0700
commit844fe207206b6708f2a7e05214857c92c4b7d28b (patch)
tree4182419dc16da692ddb0a554d9951e0ce6e99599 /src/comp
parent54aff74af093cb15310283e1edaa1693f07b525f (diff)
downloadrust-844fe207206b6708f2a7e05214857c92c4b7d28b.tar.gz
rust-844fe207206b6708f2a7e05214857c92c4b7d28b.zip
Fix some nested patterns in rustc
In rustc, nested patterns were potentially matching when they shouldn't
match, because a loop index wasn't being incremented. Fixed it and added
one test case.
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/middle/trans.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index 75c7aa8448b..a37308dda9b 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -3772,6 +3772,8 @@ fn trans_pat_match(@block_ctxt cx, @ast.pat pat, ValueRef llval,
                     auto subpat_res = trans_pat_match(matched_cx, subpat,
                                                       llsubval, next_cx);
                     matched_cx = subpat_res.bcx;
+
+                    i += 1;
                 }
             }