Skip to main content

luaur_compiler/methods/
table_mutation_tracker_visit_constant_folding_alt_c.rs

1use crate::records::table_mutation_tracker::TableMutationTracker;
2use luaur_ast::records::ast_stat_local::AstStatLocal;
3use luaur_ast::records::ast_visitor::AstVisitor;
4
5impl<'a> TableMutationTracker<'a> {
6    pub fn visit_ast_stat_local(&mut self, node: *mut AstStatLocal) -> bool {
7        if node.is_null() {
8            return false;
9        }
10
11        unsafe {
12            let node_ref = &*node;
13
14            for i in 0..node_ref.values.len().min(node_ref.vars.len()) {
15                let value_ptr = *node_ref
16                    .values
17                    .as_slice()
18                    .get(i)
19                    .unwrap_or(&core::ptr::null_mut());
20                self.mark_escaped_impl(value_ptr);
21            }
22        }
23
24        true
25    }
26}