Changeset: 7a21758ce2fc for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7a21758ce2fc Modified Files: monetdb5/modules/kernel/algebra.c Branch: Jan2014 Log Message:
Add some asserts to hopefully help Coverity. diffs (37 lines): diff --git a/monetdb5/modules/kernel/algebra.c b/monetdb5/modules/kernel/algebra.c --- a/monetdb5/modules/kernel/algebra.c +++ b/monetdb5/modules/kernel/algebra.c @@ -378,7 +378,7 @@ ALGminany(ptr result, int *bid) ptr p; str msg = MAL_SUCCEED; - if ((b = BATdescriptor(*bid)) == NULL) + if (result == NULL || (b = BATdescriptor(*bid)) == NULL) throw(MAL, "algebra.min", RUNTIME_OBJECT_MISSING); if (!ATOMlinear(b->ttype)) { @@ -390,6 +390,7 @@ ALGminany(ptr result, int *bid) * (ptr *) result = p = BATmin(b, NULL); } else { p = BATmin(b, result); + assert(p == result); } if (p == NULL) msg = createException(MAL, "algebra.min", GDK_EXCEPTION); @@ -405,7 +406,7 @@ ALGmaxany(ptr result, int *bid) ptr p; str msg = MAL_SUCCEED; - if ((b = BATdescriptor(*bid)) == NULL) + if (result == NULL || (b = BATdescriptor(*bid)) == NULL) throw(MAL, "algebra.max", RUNTIME_OBJECT_MISSING); if (!ATOMlinear(b->ttype)) { @@ -417,6 +418,7 @@ ALGmaxany(ptr result, int *bid) * (ptr *) result = p = BATmax(b, NULL); } else { p = BATmax(b, result); + assert(p == result); } if (p == NULL) msg = createException(MAL, "algebra.max", GDK_EXCEPTION); _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list