Changeset: 7519b1626d0a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7519b1626d0a
Modified Files:
        monetdb5/mal/mal_instruction.c
Branch: default
Log Message:

fndConstant should not match ptr variables.
This is what VALget used to do by returning NULL for ptr variables,
but it is better to be explicit.


diffs (26 lines):

diff --git a/monetdb5/mal/mal_instruction.c b/monetdb5/mal/mal_instruction.c
--- a/monetdb5/mal/mal_instruction.c
+++ b/monetdb5/mal/mal_instruction.c
@@ -1401,15 +1401,19 @@ int
 fndConstant(MalBlkPtr mb, const ValRecord *cst, int depth)
 {
        int i, k;
-       const void *p = VALptr(cst);
+       const void *p;
 
+       /* pointers never match */
+       if (ATOMstorage(cst->vtype) == TYPE_ptr)
+               return -1;
+
+       p = VALptr(cst);
        k = mb->vtop - depth;
        if (k < 0)
                k = 0;
        for (i = mb->vtop - 1; i >= k; i--) {
                VarPtr v = getVar(mb, i);
-
-               if (v && isVarConstant(mb, i) && v->type == cst->vtype && p && 
ATOMcmp(cst->vtype, VALptr(&v->value), p) == 0)
+               if (v && isVarConstant(mb, i) && v->type == cst->vtype && 
ATOMcmp(cst->vtype, VALptr(&v->value), p) == 0)
                        return i;
        }
        return -1;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to