Update of /cvsroot/monetdb/pathfinder/compiler/core
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv7079/core

Modified Files:
        simplify.brg 
Log Message:
-- Fix bug introduced last week by a new non-terminal FunExpr.

   (A rewrite resulted in an operator that cannot be assigned to the same
    non-terminal as the original operator. Because we continued rewriting
    without returning to the outer-most scope first the state machine got
    into trouble. The solution is to apply the rewrite in such a way that
    the new node is of the same kind as the original one which avoids any
    non-terminal conflicts.)


Index: simplify.brg
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/core/simplify.brg,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- simplify.brg        7 Dec 2007 13:55:36 -0000       1.34
+++ simplify.brg        14 Dec 2007 13:30:03 -0000      1.35
@@ -617,7 +617,7 @@
                 break;
 
 
-            /* CoreExpr:           apply (arg (CoreExpr,
+            /* FunExpr:            apply (arg (CoreExpr,
                                                arg (CoreExpr,
                                                     arg (CoreExpr,
                                                          FunctionArgs)))) */
@@ -630,17 +630,17 @@
                 if (! PFqname_eq (p->sem.fun->qname,
                                   PFqname (PFns_fn, "concat"))) {
 
-                    PFvar_t *v = new_var (NULL);
                     PFfun_t *fn_concat = function (PFqname (PFns_fn, 
"concat"));
 
-                    *p = *flwr (let (letbind (
-                                         var (v),
-                                         apply (fn_concat,
-                                                arg (LL(p), 
-                                                     arg (LRL(p), 
-                                                          nil ())))),
-                                     nil ()),
-                                apply (fn_concat, arg (var (v), LRR(p))));
+                    /* The result must refer to the same parent non-terminal
+                       FunExpr as otherwise the next reduce() call fails. */
+                    *p = *apply (fn_concat,
+                                 arg (apply (fn_concat,
+                                             arg (LL(p), 
+                                                  arg (LRL(p), 
+                                                       nil ()))),
+                                      LRR(p)));
+
                     relabel (p, kids);
                     rewrite_again = true;
                 }


-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to