From d12a8a886caf2e0edf33c1af831b1df990d2c892 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sat, 24 Dec 2016 12:32:38 +1100 Subject: MIR Gen - Raise values from LValue::Deref --- src/mir/mir_builder.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/mir/mir_builder.cpp') diff --git a/src/mir/mir_builder.cpp b/src/mir/mir_builder.cpp index 835d2ab7..367c4aa1 100644 --- a/src/mir/mir_builder.cpp +++ b/src/mir/mir_builder.cpp @@ -341,6 +341,12 @@ void MirBuilder::raise_variables(const Span& sp, const ::MIR::LValue& val) TU_MATCH_DEF(::MIR::LValue, (val), (e), ( ), + (Deref, + // TODO: This may not be correct, because it can change the drop points and ordering + // HACK: Working around cases where values are dropped while the result is not yet used. + raise_variables(sp, *e.val); + ), + // Actual value types (Variable, auto idx = e; auto scope_it = m_scope_stack.rbegin(); -- cgit v1.2.3