diff options
author | John Hodge <tpg@mutabah.net> | 2016-11-05 15:51:10 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-11-05 15:51:10 +0800 |
commit | 87e5aba682a8d6d8123fe66a4165e39a33572a9a (patch) | |
tree | 5690be6ed5d9ce6dc53d5b8720a66007161b15fa /src/mir/mir_builder.cpp | |
parent | d9dc2ca34c281859791c0f8e767eb0c8fdc70eb4 (diff) | |
download | mrust-87e5aba682a8d6d8123fe66a4165e39a33572a9a.tar.gz |
MIR Gen - Fix invalidated LValue in box move hack
Diffstat (limited to 'src/mir/mir_builder.cpp')
-rw-r--r-- | src/mir/mir_builder.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mir/mir_builder.cpp b/src/mir/mir_builder.cpp index c07fdcdc..b0f14a28 100644 --- a/src/mir/mir_builder.cpp +++ b/src/mir/mir_builder.cpp @@ -1072,9 +1072,9 @@ void MirBuilder::moved_lvalue(const Span& sp, const ::MIR::LValue& lv) // 1. If the inner lvalue isn't a slot with move information, move out of the lvalue into a temporary (with standard temp scope) TU_MATCH_DEF( ::MIR::LValue, (*e.val), (ei), ( - //TODO(sp, "Move Box out of indirect access " << *e.val << " and into a temp"); with_val_type(sp, *e.val, [&](const auto& ty){ inner_lv = this->new_temporary(ty); }); this->push_stmt_assign(sp, inner_lv.clone(), ::MIR::RValue( mv$(*e.val) )); + *e.val = inner_lv.clone(); ), (Variable, inner_lv = ::MIR::LValue(ei); |