We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6653fa5 commit db7197fCopy full SHA for db7197f
1 file changed
Packages/blueamulet.udonsharpoptimizer/Editor/Optimizations/OPTCopyLoad.cs
@@ -13,8 +13,8 @@ public bool Enabled()
13
14
public void ProcessInstruction(Optimizer optimizer, List<AssemblyInstruction> instrs, int i)
15
{
16
- // Remove Copy: Copy + JumpIf
17
- if (instrs[i] is CopyInstruction cInst && instrs[i + 1] is PushInstruction pInst)
+ // Remove Copy: Copy + Push
+ if (instrs[i] is CopyInstruction cInst && i < instrs.Count - 1 && instrs[i + 1] is PushInstruction pInst)
18
19
if (Optimizer.IsPrivate(cInst.TargetValue) && cInst.TargetValue.UniqueID == pInst.PushValue.UniqueID && !optimizer.HasJump(pInst) && !optimizer.ReadScan(n => n == i + 1, cInst.TargetValue))
20
0 commit comments