Skip to content

Commit 4480701

Browse files
committed
---
yaml --- r: 3147 b: refs/heads/master c: 4673eb6 h: refs/heads/master i: 3145: 2fa23ec 3143: edb55f1 v: v3
1 parent b51b81b commit 4480701

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
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: 741e77174c89723b05eb3dd79c3c47b2d0cd24d8
2+
refs/heads/master: 4673eb6839852b3902dc6855cce48d195c3b4092

trunk/src/comp/middle/trans.rs

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2164,10 +2164,26 @@ fn make_cmp_glue(&@block_ctxt cx, ValueRef lhs0, ValueRef rhs0, &ty::t t,
21642164
// If we hit == all the way through the minimum-shared-length
21652165
// section, default to judging the relative sequence lengths.
21662166

2167-
r =
2168-
compare_numerical_values(scx, vec_fill(scx, lhs),
2169-
vec_fill(scx, rhs), unsigned_int,
2170-
llop);
2167+
auto lhs_fill;
2168+
auto rhs_fill;
2169+
auto bcx;
2170+
if (ty::sequence_is_interior(cx.fcx.lcx.ccx.tcx, t)) {
2171+
auto lad = ivec::get_len_and_data(scx, lhs,
2172+
ty::sequence_element_type(cx.fcx.lcx.ccx.tcx, t));
2173+
bcx = lad._2;
2174+
lhs_fill = lad._0;
2175+
lad = ivec::get_len_and_data(bcx, rhs,
2176+
ty::sequence_element_type(cx.fcx.lcx.ccx.tcx, t));
2177+
bcx = lad._2;
2178+
rhs_fill = lad._0;
2179+
} else {
2180+
lhs_fill = vec_fill(scx, lhs);
2181+
rhs_fill = vec_fill(scx, rhs);
2182+
bcx = scx;
2183+
}
2184+
2185+
r = compare_numerical_values(bcx, lhs_fill, rhs_fill,
2186+
unsigned_int, llop);
21712187
r.bcx.build.Store(r.val, flag);
21722188
} else {
21732189
// == and <= default to true if they find == all the way. <

0 commit comments

Comments
 (0)