Allow for cloning inner values
This commit is contained in:
parent
965ad5797f
commit
9a4f0dc5d8
@ -265,7 +265,7 @@ impl mir::Statement {
|
|||||||
) -> Option<InstructionValue> {
|
) -> Option<InstructionValue> {
|
||||||
match &self.0 {
|
match &self.0 {
|
||||||
mir::StmtKind::Let(NamedVariableRef(ty, name, _), mutable, expression) => {
|
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(
|
scope.stack_values.insert(
|
||||||
name.clone(),
|
name.clone(),
|
||||||
StackValue(
|
StackValue(
|
||||||
|
@ -14,7 +14,10 @@ fn main() -> u32 {
|
|||||||
let val1 = 0;
|
let val1 = 0;
|
||||||
let val2 = 1;
|
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];
|
return value[0].second[2];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user