diff options
| author | Roy Frostig <[email protected]> | 2010-07-19 18:19:31 -0700 |
|---|---|---|
| committer | Roy Frostig <[email protected]> | 2010-07-19 18:25:26 -0700 |
| commit | fde9ca0937171b77542028ef433fddf979aa506b (patch) | |
| tree | fcf675dbbca7d865cc05b8cb76683b7de5138e86 /src/boot | |
| parent | Include the statements on the LHS of a binop when desugaring. Closes #117. (diff) | |
| download | rust-fde9ca0937171b77542028ef433fddf979aa506b.tar.xz rust-fde9ca0937171b77542028ef433fddf979aa506b.zip | |
Autoderef objects when passing them as implicit (indirect) arg upon vtbl-dispatch. Add testcase and XFAIL it on LLVM. Closes #112.
Diffstat (limited to 'src/boot')
| -rw-r--r-- | src/boot/me/trans.ml | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/boot/me/trans.ml b/src/boot/me/trans.ml index 6f496775..d1e707b7 100644 --- a/src/boot/me/trans.ml +++ b/src/boot/me/trans.ml @@ -3912,8 +3912,17 @@ let trans_visitor if cc = CALL_direct then zero else - let (pair_cell, _) = trans_lval pair_lval in - Il.Cell (get_element_ptr pair_cell Abi.fn_field_closure) + let (pair_cell, ty) = trans_lval pair_lval in + let (pair_cell, _) = + if cc = CALL_vtbl + (* |pair_lval| here is the obj to whose vtbl we're dispatching. + * Said obj might have been auto-deref'ed for the method call, + * so we have to be sure to do the same here. + *) + then deref_ty DEREF_all_boxes false pair_cell ty + else (pair_cell, ty) + in + Il.Cell (get_element_ptr pair_cell Abi.binding_field_bound_data) and call_ctrl flv : call_ctrl = if lval_is_static cx flv |