Browse Source

Fix: unintended instruction merge

Akeit0 8 months ago
parent
commit
03b872952f
1 changed files with 0 additions and 14 deletions
  1. 0 14
      src/Lua/CodeAnalysis/Compilation/FunctionCompilationContext.cs

+ 0 - 14
src/Lua/CodeAnalysis/Compilation/FunctionCompilationContext.cs

@@ -159,9 +159,6 @@ public class FunctionCompilationContext : IDisposable
                         case OpCode.GetUpVal:
                         case OpCode.GetTabUp:
                         case OpCode.GetTable  when !activeLocals[lastInstruction.B]:
-                        case OpCode.SetTabUp:
-                        case OpCode.SetUpVal:
-                        case OpCode.SetTable:
                         case OpCode.NewTable:
                         case OpCode.Self:
                         case OpCode.Add:
@@ -271,17 +268,6 @@ public class FunctionCompilationContext : IDisposable
                     return;
                 }
 
-                break;
-            case OpCode.Return:
-                if (lastInstruction.OpCode == OpCode.Move && instruction.B == 2 && lastInstruction.B < 256)
-                {
-                    lastInstruction = instruction with { A = (byte)lastInstruction.B };
-
-                    instructionPositions[^1] = position;
-                    incrementStackPosition = false;
-                    return;
-                }
-
                 break;
         }