From: aclement Date: Tue, 6 Dec 2005 11:28:20 +0000 (+0000) Subject: fix for pr117854 - first part, broken switch statement. X-Git-Tag: V1_5_0RC1~53 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f40d02927635b6171083229fe6d48f326da06cc7;p=aspectj.git fix for pr117854 - first part, broken switch statement. --- diff --git a/bcel-builder/src/org/aspectj/apache/bcel/generic/SWITCH.java b/bcel-builder/src/org/aspectj/apache/bcel/generic/SWITCH.java index fb030134d..9253e796b 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/generic/SWITCH.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/generic/SWITCH.java @@ -59,7 +59,7 @@ package org.aspectj.apache.bcel.generic; * TABLESWITCH instruction, depending on whether the match values (int[]) can be * sorted with no gaps between the numbers. * - * @version $Id: SWITCH.java,v 1.3 2005/08/25 11:35:49 aclement Exp $ + * @version $Id: SWITCH.java,v 1.4 2005/12/06 11:28:24 aclement Exp $ * @author M. Dahm */ public final class SWITCH implements CompoundInstruction { @@ -170,10 +170,10 @@ public final class SWITCH implements CompoundInstruction { * @return match is sorted in ascending order with no gap bigger than max_gap? */ private final boolean matchIsOrdered(int max_gap) { - for(int i=1; i < match_length; i++) - if(match[i] - match[i-1] > max_gap) - return false; - + for(int i=1; i < match_length; i++) { + int diff = (match[i]-match[i-1]); + if(diff > max_gap || diff<0) return false; + } return true; } diff --git a/lib/bcel/bcel-src.zip b/lib/bcel/bcel-src.zip index a38a34a37..8ae67e418 100644 Binary files a/lib/bcel/bcel-src.zip and b/lib/bcel/bcel-src.zip differ diff --git a/lib/bcel/bcel.jar b/lib/bcel/bcel.jar index acb3fba1d..dcf03d7b0 100644 Binary files a/lib/bcel/bcel.jar and b/lib/bcel/bcel.jar differ