mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-04-18 03:00:27 -04:00
Allow sub instructions to be simplified to mov
This commit is contained in:
@@ -493,7 +493,8 @@ impl FnState {
|
||||
| OpRightShift(_, _, dst)
|
||||
| OpRightShiftUnsigned(_, _, dst)
|
||||
| InstanceOf(_, _, dst)
|
||||
| In(_, _, dst) => match self.get(dst.name.clone()).try_to_value() {
|
||||
| In(_, _, dst)
|
||||
| Sub(_, _, dst) => match self.get(dst.name.clone()).try_to_value() {
|
||||
Some(value) => *instr = Instruction::Mov(value, dst.clone()),
|
||||
None => {}
|
||||
},
|
||||
@@ -506,7 +507,6 @@ impl FnState {
|
||||
| Call(_, _, _)
|
||||
| Apply(_, _, _, _)
|
||||
| Bind(_, _, _)
|
||||
| Sub(_, _, _)
|
||||
| SubMov(_, _, _)
|
||||
| SubCall(_, _, _, _)
|
||||
| Jmp(_)
|
||||
|
||||
Reference in New Issue
Block a user