Re: [Monetdb-developers] [Monetdb-checkins] MonetDB5/src/optimizer opt_replicator.mx, , 1.30, 1.31
On Mon, Mar 03, 2008 at 02:35:30PM +0000, Milena Ivanova wrote:
Update of /cvsroot/monetdb/MonetDB5/src/optimizer In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv4109/src/optimizer
Modified Files: opt_replicator.mx Log Message: Make sure the constant exists in var area of replicator.
Just a simple question out of curiosity: It seems, the new variable v1 is only use in the new if-statement's body, right? Hence, why don't you also declare the variable v1 as "local" variable in the if-body? The is no need to have it as "global" variable in function newReplica(), is there? Stefan
Index: opt_replicator.mx =================================================================== RCS file: /cvsroot/monetdb/MonetDB5/src/optimizer/opt_replicator.mx,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- opt_replicator.mx 2 Mar 2008 12:08:46 -0000 1.30 +++ opt_replicator.mx 3 Mar 2008 14:35:27 -0000 1.31 @@ -438,7 +438,7 @@ static int newReplica(MalStkPtr s, InstrPtr p, bit keep) { int i, j, k, c, bid, r; - ValPtr v; + ValPtr v, v1; InstrPtr p1;
assureSpace(); @@ -446,7 +446,12 @@ for(i = 0; i< p->argc; i++){ j = p->argv[i]; v = &s->stk[j]; - c = defConstant(repl, v->vtype, v); + c = fndConstant(repl, v); + if ( c < 0 ){ + v1 = VALnew(); + VALcopy(v1,v); + c = defConstant(repl, v1->vtype, v1); + } setArg(p1,i,c);
if ((i > 0) ||
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Monetdb-checkins mailing list Monetdb-checkins@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-checkins
-- | Dr. Stefan Manegold | mailto:Stefan.Manegold@cwi.nl | | CWI, P.O.Box 94079 | http://www.cwi.nl/~manegold/ | | 1090 GB Amsterdam | Tel.: +31 (20) 592-4212 | | The Netherlands | Fax : +31 (20) 592-4312 |
participants (1)
-
Stefan Manegold