Skip to content

Commit c73c9a5

Browse files
committed
---
yaml --- r: 3834 b: refs/heads/master c: 0e59493 h: refs/heads/master v: v3
1 parent 6a42547 commit c73c9a5

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: bde52808f0fa6d44b7d738ba2e79a4192ccdd54b
2+
refs/heads/master: 0e594939aa032c074df925d03c7d1289d6c2efc2

trunk/src/comp/middle/trans.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -7129,7 +7129,7 @@ fn trans_anon_obj(@block_ctxt bcx, &span sp, &ast::anon_obj anon_obj,
71297129
methods = anon_obj.methods,
71307130
dtor = none[@ast::method]);
71317131

7132-
let result with_obj_val;
7132+
let option::t[result] with_obj_val = none;
71337133
let ty::t with_obj_ty;
71347134
auto vtbl;
71357135
alt (anon_obj.with_obj) {
@@ -7155,7 +7155,7 @@ fn trans_anon_obj(@block_ctxt bcx, &span sp, &ast::anon_obj anon_obj,
71557155
// If with_obj (the object being extended) exists, translate it.
71567156
// Translating with_obj returns a ValueRef (pointer to a 2-word
71577157
// value) wrapped in a result.
7158-
with_obj_val = trans_expr(bcx, e);
7158+
with_obj_val = some(trans_expr(bcx, e));
71597159

71607160
// TODO: What makes more sense to get the type of an expr --
71617161
// calling ty::expr_ty(ccx.tcx, e) on it or calling
@@ -7332,9 +7332,13 @@ fn trans_anon_obj(@block_ctxt bcx, &span sp, &ast::anon_obj anon_obj,
73327332
GEP_tup_like(bcx, body_ty, body.val,
73337333
~[0, abi::obj_body_elt_with_obj]);
73347334
bcx = body_with_obj.bcx;
7335-
bcx = copy_val(bcx, INIT, body_with_obj.val,
7336-
with_obj_val.val,
7337-
with_obj_ty).bcx;
7335+
alt (with_obj_val) {
7336+
case (some(?v)) {
7337+
bcx = copy_val(bcx, INIT, body_with_obj.val,
7338+
v.val, with_obj_ty).bcx;
7339+
}
7340+
case (_) {}
7341+
}
73387342

73397343
// Store box ptr in outer pair.
73407344
auto p = bcx.build.PointerCast(box.val, llbox_ty);

0 commit comments

Comments
 (0)