Changeset: 97998a7ac3e3 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=97998a7ac3e3
Modified Files:
        
Branch: default
Log Message:

Merge with Oct2010 branch.


diffs (69 lines):

diff -r 383a00ae3261 -r 97998a7ac3e3 MonetDB5/src/mal/mal_instruction.mx
--- a/MonetDB5/src/mal/mal_instruction.mx       Wed Sep 08 10:56:05 2010 +0200
+++ b/MonetDB5/src/mal/mal_instruction.mx       Wed Sep 08 13:54:50 2010 +0200
@@ -1657,9 +1657,10 @@
 {
        int *vars, cnt = 0, i, j;
        InstrPtr q;
-       int actions;
 
        vars= (int *) GDKzalloc(mb->vtop * sizeof(int));
+       if (vars == NULL)
+               return;                                 /* forget it if we run 
out of memory */
 
        /* build the alias table */
        for (i = 0; i < mb->vtop; i++) {
@@ -1688,7 +1689,6 @@
                }
                cnt++;
        }
-       actions = mb->vtop - cnt;
 #ifdef DEBUG_REDUCE
        mnstr_printf(GDKout, "Variable reduction %d -> %d\n", mb->vtop, cnt);
        for(i=0; i<mb->vtop;i++)
@@ -1696,7 +1696,7 @@
 #endif
 
        /* remap all variable references to their new position. */
-       if (actions) {
+       if (cnt < mb->vtop) {
                for (i = 0; i < mb->stop; i++) {
                        q = getInstrPtr(mb, i);
                        for (j = 0; j < q->argc; j++)
@@ -1713,8 +1713,7 @@
        mnstr_printf(GDKout, "After reduction \n");
        printFunction(GDKout,mb,0,0);
 #endif
-       if (vars)
-               GDKfree(vars);
+       GDKfree(vars);
        mb->vtop = cnt;
 }
 void
diff -r 383a00ae3261 -r 97998a7ac3e3 sql/src/backends/monet5/sql_scenario.mx
--- a/sql/src/backends/monet5/sql_scenario.mx   Wed Sep 08 10:56:05 2010 +0200
+++ b/sql/src/backends/monet5/sql_scenario.mx   Wed Sep 08 13:54:50 2010 +0200
@@ -570,7 +570,7 @@
 static void
 freeVariables(Client c, MalBlkPtr mb, MalStkPtr glb, int start)
 {
-       int i;
+       int i, j;
 
        for (i = start; i < mb->vtop;) {
                if (glb) {
@@ -585,6 +585,14 @@
                i++;
        }
        mb->vtop = start;
+       for (i = j = 0; i < mb->ptop; i++) {
+               if (mb->prps[i].var < start) {
+                       if (i > j)
+                               mb->prps[j] = mb->prps[i];
+                       j++;
+               }
+       }
+       mb->ptop = j;
 }
 
 /* #define _SQL_COMPILE */
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to