Allow for cloning inner values
This commit is contained in:
		
							parent
							
								
									965ad5797f
								
							
						
					
					
						commit
						9a4f0dc5d8
					
				| @ -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( | ||||
|  | ||||
| @ -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]; | ||||
| } | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user