Skip to content

Commit b536b60

Browse files
committed
---
yaml --- r: 1705 b: refs/heads/master c: 8ff77b1 h: refs/heads/master i: 1703: 9b52e11 v: v3
1 parent 24c7b39 commit b536b60

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
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: 9ad9d3783dd1d2ac4962b03ba63d0a1ed4d8c00f
2+
refs/heads/master: 8ff77b14a933a6ca5c8275e6f08ae26ea803107b

trunk/src/comp/middle/trans.rs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2066,8 +2066,15 @@ fn iter_sequence_inner(@block_ctxt cx,
20662066
@block_ctxt cx,
20672067
ValueRef dst,
20682068
ValueRef src) -> result {
2069-
auto llty = type_of(cx.fcx.ccx, elt_ty);
2070-
auto p = cx.build.PointerCast(src, T_ptr(llty));
2069+
auto llptrty;
2070+
if (!ty.type_has_dynamic_size(elt_ty)) {
2071+
auto llty = type_of(cx.fcx.ccx, elt_ty);
2072+
llptrty = T_ptr(llty);
2073+
} else {
2074+
llptrty = T_ptr(T_ptr(T_i8()));
2075+
}
2076+
2077+
auto p = cx.build.PointerCast(src, llptrty);
20712078
ret f(cx, load_scalar_or_boxed(cx, p, elt_ty), elt_ty);
20722079
}
20732080

@@ -2094,7 +2101,13 @@ fn iter_sequence(@block_ctxt cx,
20942101
auto lenptr = cx.build.GEP(v, vec(C_int(0),
20952102
C_int(abi.vec_elt_fill)));
20962103

2097-
auto llunit_ty = type_of(cx.fcx.ccx, elt_ty);
2104+
auto llunit_ty;
2105+
if (ty.type_has_dynamic_size(elt_ty)) {
2106+
llunit_ty = T_i8();
2107+
} else {
2108+
llunit_ty = type_of(cx.fcx.ccx, elt_ty);
2109+
}
2110+
20982111
auto bcx = cx;
20992112

21002113
auto len = bcx.build.Load(lenptr);

0 commit comments

Comments
 (0)