diff --git a/VirtualMachine/Ceres/TranslationEngine/Compiler.Expression.By.cs b/VirtualMachine/Ceres/TranslationEngine/Compiler.Expression.By.cs index 00d796d..84a0404 100644 --- a/VirtualMachine/Ceres/TranslationEngine/Compiler.Expression.By.cs +++ b/VirtualMachine/Ceres/TranslationEngine/Compiler.Expression.By.cs @@ -33,8 +33,12 @@ public override void Visit(ByExpression byExpression) Chunk.CodeGenerator.Emit(arms[i].DeepEquality ? OpCode.DEQ : OpCode.CEQ); Chunk.CodeGenerator.Emit(OpCode.FJMP, labels[i]); - Chunk.CodeGenerator.Emit(OpCode.POP); - + + if (i < arms.Count - 1) + { + Chunk.CodeGenerator.Emit(OpCode.POP); + } + Visit(arms[i].ValueArm); if (arms[i].ValueArm is Expression)