Changeset: 933c600f4788 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=933c600f4788
Modified Files:
        monetdb5/modules/mal/mal_io.mx
Branch: Apr2011
Log Message:

Add a cast plus a check that the cast works.
Yet another warning squashed.


diffs (18 lines):

diff --git a/monetdb5/modules/mal/mal_io.mx b/monetdb5/modules/mal/mal_io.mx
--- a/monetdb5/modules/mal/mal_io.mx
+++ b/monetdb5/modules/mal/mal_io.mx
@@ -880,7 +880,13 @@
                        BBPunfix(b->batCacheid);
                        throw(MAL, "io.imports", OPERATION_FAILED "Empty file 
or fstat broken");
                }
-               base = cur = (char *) MT_mmap(*fnme, MMAP_SEQUENTIAL, 0, 
st.st_size);
+#if SIZEOF_SIZE_T == SIZEOF_INT
+               if (st.st_size > ~ (size_t) 0) {
+                       BBPunfix(b->batCacheid);
+                       throw(MAL, "io.imports", OPERATION_FAILED "File too 
large");
+               }
+#endif
+               base = cur = (char *) MT_mmap(*fnme, MMAP_SEQUENTIAL, 0, 
(size_t) st.st_size);
                end = cur + st.st_size;
                if (cur == (char *) -1) {
                        BBPunfix(b->batCacheid);
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to