From 102c92088f7818b8d8ca9867358d46cc13f92356 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 2 Oct 2020 10:12:12 +0200 Subject: Rearrange parenthesis to fix an IndexOutOfRangeException that occured because the 'start > 0' condition didn't cover the entire expression. --- reflect/Metadata/Tables.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reflect/Metadata/Tables.cs b/reflect/Metadata/Tables.cs index d30cc42b..9a7f6cce 100644 --- a/reflect/Metadata/Tables.cs +++ b/reflect/Metadata/Tables.cs @@ -457,13 +457,13 @@ namespace IKVM.Reflection.Metadata return new Enumerator(null, 0, 1, -1); } int start = index; - while (start > 0 && (((records [start - 1].FilterKey & 0xFFFFFF) == (token & 0xFFFFFF))) || ((records [start - 1].FilterKey & 0xFFFFFF) == 0)) + while (start > 0 && (((records [start - 1].FilterKey & 0xFFFFFF) == (token & 0xFFFFFF)) || ((records [start - 1].FilterKey & 0xFFFFFF) == 0))) { start--; } int end = index; int max = table.RowCount - 1; - while (end < max && (((records [end + 1].FilterKey & 0xFFFFFF) == (token & 0xFFFFFF))) || ((records [end + 1].FilterKey & 0xFFFFFF) == 0)) + while (end < max && (((records [end + 1].FilterKey & 0xFFFFFF) == (token & 0xFFFFFF)) || ((records [end + 1].FilterKey & 0xFFFFFF) == 0))) { end++; } -- cgit v1.2.3