Changeset: a25f8ed0f7b6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a25f8ed0f7b6
Modified Files:
        gdk/gdk_hash.h
        sql/storage/bat/bat_logger.c
Branch: Sep2022
Log Message:

Some small fixes.
Functions that dereference their arguments should not be declared
__const__, but only __pure__.
However unlikely, BATproject can fail.


diffs (28 lines):

diff --git a/gdk/gdk_hash.h b/gdk/gdk_hash.h
--- a/gdk/gdk_hash.h
+++ b/gdk/gdk_hash.h
@@ -211,7 +211,7 @@ HASHgetlink(const Hash *h, BUN i)
 #define hash_flt(H,V)  hash_int(H,V)
 #define hash_dbl(H,V)  hash_lng(H,V)
 
-static inline BUN __attribute__((__const__))
+static inline BUN __attribute__((__pure__))
 mix_uuid(const uuid *u)
 {
        ulng u1, u2;
diff --git a/sql/storage/bat/bat_logger.c b/sql/storage/bat/bat_logger.c
--- a/sql/storage/bat/bat_logger.c
+++ b/sql/storage/bat/bat_logger.c
@@ -1598,6 +1598,12 @@ upgrade(old_logger *lg)
                                BAT *b3;
                                b3 = BATproject(b2, mapnew);
                                bat_destroy(b2);
+                               if (b3 == NULL) {
+                                       bat_destroy(b1);
+                                       bat_destroy(orig);
+                                       bat_destroy(b);
+                                       goto bailout;
+                               }
                                rc = BATreplace(b, b1, b3, false);
                                bat_destroy(b1);
                                bat_destroy(b3);
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to