From 874d6a3e33c1b9370ac1cb2a6b0f796bdb4b0242 Mon Sep 17 00:00:00 2001 From: Roman Marusyk Date: Sat, 29 Jan 2022 05:20:10 +0200 Subject: [PATCH] Remove CheckForOverflowUnderflow (#63825) * Remove set false to CheckForOverflowUnderflow due to it is disabled by default * Use checked instead of CheckForOverflowUnderflow --- src/libraries/Directory.Build.props | 2 -- src/tests/JIT/Regression/Dev11/dev11_4421/Dev11_4421.cs | 7 +++++-- .../JIT/Regression/Dev11/dev11_4421/Dev11_4421.csproj | 1 - 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libraries/Directory.Build.props b/src/libraries/Directory.Build.props index 49c6d278ee1d2..a5cc7f6825008 100644 --- a/src/libraries/Directory.Build.props +++ b/src/libraries/Directory.Build.props @@ -87,8 +87,6 @@ - - false true false diff --git a/src/tests/JIT/Regression/Dev11/dev11_4421/Dev11_4421.cs b/src/tests/JIT/Regression/Dev11/dev11_4421/Dev11_4421.cs index f85ed85ceb0ee..8bd8ef2652224 100644 --- a/src/tests/JIT/Regression/Dev11/dev11_4421/Dev11_4421.cs +++ b/src/tests/JIT/Regression/Dev11/dev11_4421/Dev11_4421.cs @@ -10,8 +10,11 @@ private static int Main() int Var1, Temp; try { - for (Temp = int.MaxValue - 3; Temp <= int.MaxValue - 1; Temp++) - Var1 = (int)(2 + Temp); + checked + { + for (Temp = int.MaxValue - 3; Temp <= int.MaxValue - 1; Temp++) + Var1 = (int)(2 + Temp); + } } catch (Exception ex) { diff --git a/src/tests/JIT/Regression/Dev11/dev11_4421/Dev11_4421.csproj b/src/tests/JIT/Regression/Dev11/dev11_4421/Dev11_4421.csproj index 0ac905c8265b7..68c5b85dcaba4 100644 --- a/src/tests/JIT/Regression/Dev11/dev11_4421/Dev11_4421.csproj +++ b/src/tests/JIT/Regression/Dev11/dev11_4421/Dev11_4421.csproj @@ -5,7 +5,6 @@ PdbOnly True - True