This is occurring for us in the Arrays.mergeSort() code.  A reduced
testcase (which looks like the binarySearch code) is in the webkit bug
tracking system at:

It appears that in some complex expressions the right shift operator
is not evaluating correctly.  Assigning the result of the right shift
to a temporary variable and then using it appears to make the problem
go away.

As a temporary fix, we're patching to assign
the result of the right shift to a temporary variable before using it.
If you're using binary search you'd need to patch those functions as
well.  It's a bit of a hack, but it seems to work. I've included our
patch below, in case it is helpful to someone.

diff --git a/super/com/google/gwt/emul/java/util/ b/super/
index 89dcc33..b7ba6fa 100644
--- a/super/com/google/gwt/emul/java/util/
+++ b/super/com/google/gwt/emul/java/util/
@@ -1322,7 +1322,8 @@ public class Arrays {
     // recursively sort both halves, using the array as temp space
     int tempLow = low + ofs;
     int tempHigh = high + ofs;
-    int tempMid = tempLow + ((tempHigh - tempLow) >> 1);
+    int half = length >> 1;
+    int tempMid = tempLow + half;
     mergeSort(array, temp, tempLow, tempMid, -ofs, comp);
     mergeSort(array, temp, tempMid, tempHigh, -ofs, comp);

You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to