Changeset: 3c0b36cba29c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/3c0b36cba29c
Modified Files:
        geom/monetdb5/geom.c
Branch: geo-update
Log Message:

Get rid of the "jump-misses-init" compilation errors.

-Werror=jump-misses-init will complain if a "goto" stmt _can be_ triggered 
before all variables have got their initial values, eventhough it's harmless 
since we only use 'goto' for clean up on error.  Hence, only use 'goto free' 
after all variables have got a value.

NB: the split of "wkb **unions = GDKzalloc(sizeof(wkb *) * ngrp);" into two 
lines is also needed because of -Werror=jump-misses-init.


diffs (36 lines):

diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c
--- a/geom/monetdb5/geom.c
+++ b/geom/monetdb5/geom.c
@@ -5258,14 +5258,16 @@ static str wkbUnionAggrSubGroupedCand(ba
                (sid && !is_bat_nil(*sid) && (s = BATdescriptor(*sid)) == NULL))
        {
                msg = createException(MAL, "geom.Union", 
RUNTIME_OBJECT_MISSING);
-               goto free;
-       }
+               return msg;
+       }
+       bi = bat_iterator(b);
 
        //Fill in the values of the group aggregate operation
        if ((err = BATgroupaggrinit(b, g, e, s, &min, &max, &ngrp, &ci, 
&ncand)) != NULL)
        {
                msg = createException(MAL, "geom.Union", "%s", err);
-               goto free;
+               BBPunfix(b->batCacheid);
+               return msg;
        }
 
        //Create a new BAT column of wkb type, with lenght equal to the number 
of groups
@@ -5276,9 +5278,9 @@ static str wkbUnionAggrSubGroupedCand(ba
        }
 
        //Allocate space for the intermediate unions of wkb's
-       wkb **unions = GDKzalloc(sizeof(wkb *) * ngrp);
-
-       bi = bat_iterator(b);
+       wkb **unions;
+       unions = GDKzalloc(sizeof(wkb *) * ngrp);
+
        if (g && !BATtdense(g))
                gids = (const oid *)Tloc(g, 0);
 
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to