Skip to content

Commit f22dc4d

Browse files
committed
Fix buggy argument assembly for upcall_get_type_desc. Can now complete calls to glue of derived tydescs.
1 parent 4b06dc5 commit f22dc4d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/comp/middle/trans.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -983,14 +983,14 @@ fn get_tydesc(&@block_ctxt cx, @ty.t t) -> result {
983983
auto root = cx.fcx.ccx.tydescs.get(t);
984984

985985
auto tydescs = cx.build.Alloca(T_array(T_ptr(T_tydesc()), n_params));
986+
986987
auto i = 0;
988+
auto tdp = cx.build.GEP(tydescs, vec(C_int(0), C_int(i)));
989+
cx.build.Store(root, tdp);
990+
i += 1;
987991
for (ValueRef td in tys._1) {
988992
auto tdp = cx.build.GEP(tydescs, vec(C_int(0), C_int(i)));
989-
if (i == 0) {
990-
cx.build.Store(root, tdp);
991-
} else {
992-
cx.build.Store(td, tdp);
993-
}
993+
cx.build.Store(td, tdp);
994994
i += 1;
995995
}
996996

0 commit comments

Comments
 (0)