[PATCH] D39263: [support] remove tautological comparison in Support/Windows/Path.inc

Bob Haarman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 16:51:10 PDT 2017


inglorion created this revision.
Herald added a subscriber: hiraditya.

The removed code checks that we are able to handle a 64-bit number, but
the code we're calling takes two dwords (for a total of 64 bits), so this
is always true.


https://reviews.llvm.org/D39263

Files:
  llvm/lib/Support/Windows/Path.inc


Index: llvm/lib/Support/Windows/Path.inc
===================================================================
--- llvm/lib/Support/Windows/Path.inc
+++ llvm/lib/Support/Windows/Path.inc
@@ -721,10 +721,6 @@
 
 std::error_code mapped_file_region::init(int FD, uint64_t Offset,
                                          mapmode Mode) {
-  // Make sure that the requested size fits within SIZE_T.
-  if (Size > std::numeric_limits<SIZE_T>::max())
-    return make_error_code(errc::invalid_argument);
-
   HANDLE FileHandle = reinterpret_cast<HANDLE>(_get_osfhandle(FD));
   if (FileHandle == INVALID_HANDLE_VALUE)
     return make_error_code(errc::bad_file_descriptor);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39263.120150.patch
Type: text/x-patch
Size: 666 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171024/fd26d644/attachment.bin>


More information about the llvm-commits mailing list