Changeset: 906ed4e43830 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=906ed4e43830
Modified Files:
        monetdb5/mal/mal_resolve.mx
Branch: default
Log Message:

Allocate space directly.
There are paths through the code that otherwise might
encounter an non-initialized returtype variable.


diffs (21 lines):

diff --git a/monetdb5/mal/mal_resolve.mx b/monetdb5/mal/mal_resolve.mx
--- a/monetdb5/mal/mal_resolve.mx
+++ b/monetdb5/mal/mal_resolve.mx
@@ -160,6 +160,9 @@ findFunctionType(Module scope, MalBlkPtr
        m = scope;
        s = m->subscope[(int)(getSubScope(getFunctionId(p)))];
        if (s == 0) return -1;
+
+       returntype= (int*) GDKzalloc(p->retc * sizeof(int));
+
        while (s != NULL) {  /* single scope element check */
                if (getFunctionId(p) != s->name) {
                        s = s->skip; continue;
@@ -357,7 +360,6 @@ findFunctionType(Module scope, MalBlkPtr
                 * the resulting type can not be determined.
                 */
                s1 = 0;
-               returntype= (int*) GDKzalloc(p->retc * sizeof(int));
                if (sig->polymorphic)
                        for (k = i = 0; i < p->retc; k++, i++) {
                                int actual = getArgType(mb, p, i);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to