From a3db5aed3f9057638e1aa15b54d8fa4a11ef69db Mon Sep 17 00:00:00 2001 From: ike709 Date: Sun, 29 Dec 2024 18:04:12 -0600 Subject: [PATCH] don't fix div_zero4.dm --- .../{Tests => Broken Tests}/Tree/Const/Div_Zero/div_zero4.dm | 0 DMCompiler/Optimizer/PeepholeOptimizations.cs | 4 ---- 2 files changed, 4 deletions(-) rename Content.Tests/DMProject/{Tests => Broken Tests}/Tree/Const/Div_Zero/div_zero4.dm (100%) diff --git a/Content.Tests/DMProject/Tests/Tree/Const/Div_Zero/div_zero4.dm b/Content.Tests/DMProject/Broken Tests/Tree/Const/Div_Zero/div_zero4.dm similarity index 100% rename from Content.Tests/DMProject/Tests/Tree/Const/Div_Zero/div_zero4.dm rename to Content.Tests/DMProject/Broken Tests/Tree/Const/Div_Zero/div_zero4.dm diff --git a/DMCompiler/Optimizer/PeepholeOptimizations.cs b/DMCompiler/Optimizer/PeepholeOptimizations.cs index 47cb587c27..f695e863d2 100644 --- a/DMCompiler/Optimizer/PeepholeOptimizations.cs +++ b/DMCompiler/Optimizer/PeepholeOptimizations.cs @@ -459,10 +459,6 @@ public void Apply(DMCompiler compiler, List input, int index IOptimization.GetInstructionAndValue(input[index + 1], out var pushVal2); - if (pushVal2 == 0) { - compiler.Emit(WarningCode.BadExpression, input[index + 1].GetLocation(), "Division by zero"); - } - // At runtime, given "A / B" we pop B then A // In the peephole optimizer, index is "A", index+1 is "B" var args = new List(1) {new AnnotatedBytecodeFloat(pushVal1 / pushVal2, firstInstruction.Location)};