summaryrefslogtreecommitdiff
path: root/src/mir/helpers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mir/helpers.cpp')
-rw-r--r--src/mir/helpers.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mir/helpers.cpp b/src/mir/helpers.cpp
index 31b50246..02facac0 100644
--- a/src/mir/helpers.cpp
+++ b/src/mir/helpers.cpp
@@ -555,8 +555,18 @@ void MIR_Helper_GetLifetimes_DetermineValueLifetime(::MIR::TypeResolve& state, c
}
else
{
- // TODO: Can Argument(_) be assigned?
- // Not a direct assignment of a slot
+ // Not a direct assignment of a slot. But check if a slot is mutated as part of this.
+ ::MIR::visit::visit_mir_lvalue(lv, ValUsage::Write, [&](const auto& ilv, ValUsage vu) {
+ if( const auto* de = ilv.opt_Local() )
+ {
+ if( vu == ValUsage::Write )
+ {
+ MIR_Helper_GetLifetimes_DetermineValueLifetime(state, fcn, bb_idx, stmt_idx, lv, block_offsets, slot_lifetimes[*de]);
+ slot_lifetimes[*de].fill(block_offsets, bb_idx, stmt_idx, stmt_idx);
+ }
+ }
+ return false;
+ });
}
};