Index: gecode-3.7.1/gecode/int/sorted.cpp
===================================================================
--- gecode-3.7.1.orig/gecode/int/sorted.cpp	2010-03-03 18:40:32.000000000 +0200
+++ gecode-3.7.1/gecode/int/sorted.cpp	2011-11-17 20:15:05.242661575 +0200
@@ -50,6 +50,8 @@
 
     if (home.failed()) return;
 
+    if (x.size()==0) return;
+
     ViewArray<IntView> x0(home,x), y0(home,y), z0(home,z);
 
     GECODE_ES_FAIL(
@@ -67,6 +69,8 @@
 
     if (home.failed()) return;
 
+    if (x.size()==0) return;
+
     ViewArray<IntView> x0(home,x), y0(home,y), z0(home,0);
 
     GECODE_ES_FAIL(
