Allow for cloning inner values

This commit is contained in:
Sofia 2025-07-17 00:05:37 +03:00
parent 965ad5797f
commit 9a4f0dc5d8
2 changed files with 5 additions and 2 deletions

View File

@ -265,7 +265,7 @@ impl mir::Statement {
) -> Option<InstructionValue> {
match &self.0 {
mir::StmtKind::Let(NamedVariableRef(ty, name, _), mutable, expression) => {
let value = expression.codegen(scope, state).unwrap();
let value = expression.codegen(scope, &state.load(true)).unwrap();
scope.stack_values.insert(
name.clone(),
StackValue(

View File

@ -14,7 +14,10 @@ fn main() -> u32 {
let val1 = 0;
let val2 = 1;
value[val1].second[val2 + 1] = 99;
// value[val1].second[val2 + 1] = 99;
let mut b = value[val1];
b.second[2] = 99;
return value[0].second[2];
}