--- \dev\dmd2\src\phobos\std\regex.d	Thu Apr  8 14:00:40 2010
+++ \util\dmd2\src\phobos\std\regex.d	Sat May 29 22:36:42 2010
@@ -1983,7 +1983,7 @@
                 if (src == input.length)
                     goto Lnomatch;
                 debug(regex) printf("\tREchar '%c', src = '%c'\n",
-                        program[pc + 1], input[src]);
+                        engine.program[pc + 1], input[src]);
                 if (engine.program[pc + 1] != input[src])
                     goto Lnomatch;
                 src++;
@@ -1995,7 +1995,7 @@
                 if (src == input.length)
                     goto Lnomatch;
                 debug(regex) printf("\tREichar '%c', src = '%c'\n",
-                        program[pc + 1], input[src]);
+                		engine.program[pc + 1], input[src]);
                 c1 = engine.program[pc + 1];
                 c2 = input[src];
                 if (c1 != c2)
@@ -2012,10 +2012,10 @@
                 break;
 
             case engine.REdchar:
-                debug(regex) printf("\tREdchar '%c', src = '%c'\n",
-                        *(cast(dchar *)&program[pc + 1]), input[src]);
                 if (src == input.length)
                     goto Lnomatch;
+                debug(regex) printf("\tREdchar '%c', src = '%c'\n",
+                        *(cast(dchar *)&engine.program[pc + 1]), input[src]);
                 if (*(cast(dchar *)&engine.program[pc + 1]) != input[src])
                     goto Lnomatch;
                 src++;
@@ -2023,10 +2023,10 @@
                 break;
 
             case engine.REidchar:
-                debug(regex) printf("\tREidchar '%c', src = '%c'\n",
-                        *(cast(dchar *)&program[pc + 1]), input[src]);
                 if (src == input.length)
                     goto Lnomatch;
+                debug(regex) printf("\tREidchar '%c', src = '%c'\n",
+                        *(cast(dchar *)&engine.program[pc + 1]), input[src]);
                 c1 = *(cast(dchar *)&engine.program[pc + 1]);
                 c2 = input[src];
                 if (c1 != c2)
@@ -2057,7 +2057,7 @@
                 assert(len % E.sizeof == 0);
                 len /= E.sizeof;
                 debug(regex) printf("\tREstring x%x, '%.*s'\n", len,
-                        (&program[pc + 1 + uint.sizeof])[0 .. len]);
+                        (&engine.program[pc + 1 + uint.sizeof])[0 .. len]);
                 if (src + len > input.length)
                     goto Lnomatch;
                 if (memcmp(&engine.program[pc + 1 + uint.sizeof],
@@ -2072,7 +2072,7 @@
                 assert(len % E.sizeof == 0);
                 len /= E.sizeof;
                 debug(regex) printf("\tREistring x%x, '%.*s'\n", len,
-                        (&program[pc + 1 + uint.sizeof])[0 .. len]);
+                        (&engine.program[pc + 1 + uint.sizeof])[0 .. len]);
                 if (src + len > input.length)
                     goto Lnomatch;
                 // version (Win32)
@@ -2094,10 +2094,10 @@
 
             case engine.REtestbit:
                 pu = (cast(ushort *)&engine.program[pc + 1]);
-                debug(regex) printf("\tREtestbit %d, %d, '%c', x%02x\n",
-                        pu[0], pu[1], input[src], input[src]);
                 if (src == input.length)
                     goto Lnomatch;
+                debug(regex) printf("\tREtestbit %d, %d, '%c', x%02x\n",
+                        pu[0], pu[1], input[src], input[src]);
                 len = pu[1];
                 c1 = input[src];
                 if (c1 <= pu[0] &&
@@ -2107,11 +2107,11 @@
                 break;
 
             case engine.REbit:
+                if (src == input.length)
+                    goto Lnomatch;
                 pu = (cast(ushort *)&engine.program[pc + 1]);
                 debug(regex) printf("\tREbit %d, %d, '%c'\n",
                         pu[0], pu[1], input[src]);
-                if (src == input.length)
-                    goto Lnomatch;
                 len = pu[1];
                 c1 = input[src];
                 if (c1 > pu[0])
@@ -2123,11 +2123,11 @@
                 break;
 
             case engine.REnotbit:
+                if (src == input.length)
+                    goto Lnomatch;
                 pu = (cast(ushort *)&engine.program[pc + 1]);
                 debug(regex) printf("\tREnotbit %d, %d, '%c'\n",
                         pu[0], pu[1], input[src]);
-                if (src == input.length)
-                    goto Lnomatch;
                 len = pu[1];
                 c1 = input[src];
                 if (c1 <= pu[0] &&
@@ -2274,7 +2274,7 @@
                 n = puint[1];
                 m = puint[2];
                 debug(regex) printf("\tREnm%s len=%d, n=%u, m=%u\n",
-                        (engine.program[pc] == REnmq) ? cast(char*)"q"
+                        (engine.program[pc] == engine.REnmq) ? cast(char*)"q"
                         : cast(char*)"", len, n, m);
                 pop = pc + 1 + uint.sizeof * 3;
                 for (count = 0; count < n; count++)
