Changeset: f23931a92851 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f23931a92851
Modified Files:
        monetdb5/optimizer/opt_inline.c
        monetdb5/optimizer/opt_remap.c
Branch: nospare
Log Message:

make sure we handle more modules when rewriting multiplex functions


diffs (52 lines):

diff --git a/monetdb5/optimizer/opt_inline.c b/monetdb5/optimizer/opt_inline.c
--- a/monetdb5/optimizer/opt_inline.c
+++ b/monetdb5/optimizer/opt_inline.c
@@ -29,9 +29,10 @@ static bool OPTinlineMultiplex(Client cn
        Symbol s;
        str mod,fcn;
 
-       mod = VALget(&getVar(mb, getArg(p, 1))->value);
-       fcn = VALget(&getVar(mb, getArg(p, 2))->value);
-       if( (s= findSymbol(cntxt->usermodule, mod,fcn)) ==0 )
+       mod = VALget(&getVar(mb, getArg(p, p->retc+0))->value);
+       fcn = VALget(&getVar(mb, getArg(p, p->retc+1))->value);
+       //if( (s= findSymbol(cntxt->usermodule, mod,fcn)) ==0 )
+       if( (s= findSymbolInModule(getModule(putName(mod)), putName(fcn))) ==0 )
                return false;
        if (s->def == mb)                       /* avoid infinite recursion */
                return false;
diff --git a/monetdb5/optimizer/opt_remap.c b/monetdb5/optimizer/opt_remap.c
--- a/monetdb5/optimizer/opt_remap.c
+++ b/monetdb5/optimizer/opt_remap.c
@@ -115,13 +115,13 @@ OPTmultiplexInline(Client cntxt, MalBlkP
        int i,j,k,m, actions=0;
        int refbat=0, retc = p->retc;
        bit *upgrade;
-       Symbol s;
        str msg;
 
 
-       s= findSymbol(cntxt->usermodule,
-                       VALget(&getVar(mb, getArg(p, retc+0))->value),
-                       VALget(&getVar(mb, getArg(p, retc+1))->value));
+       str mod = VALget(&getVar(mb, getArg(p, retc+0))->value);
+       str fcn = VALget(&getVar(mb, getArg(p, retc+1))->value);
+       //Symbol s = findSymbol(cntxt->usermodule, mod,fcn);
+       Symbol s = findSymbolInModule(getModule(putName(mod)), putName(fcn));
 
        if( s== NULL || !isSideEffectFree(s->def) ||
                getInstrPtr(s->def,0)->retc != p->retc ) {
@@ -396,9 +396,10 @@ OPTremapImplementation(Client cntxt, Mal
                         * such as the calculator functions. It is particularly
                         * geared at handling the PSM code.
                         */
-                       str mod = VALget(&getVar(mb, getArg(p, 1))->value);
-                       str fcn = VALget(&getVar(mb, getArg(p, 2))->value);
-                       Symbol s = findSymbol(cntxt->usermodule, mod,fcn);
+                       str mod = VALget(&getVar(mb, getArg(p, 
p->retc+0))->value);
+                       str fcn = VALget(&getVar(mb, getArg(p, 
p->retc+1))->value);
+                       //Symbol s = findSymbol(cntxt->usermodule, mod,fcn);
+                       Symbol s = 
findSymbolInModule(getModule(putName(mod)),putName(fcn));
 
                        if (s && s->def->inlineProp ){
                                pushInstruction(mb, p);
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to