[llvm] r316814 - [support] remove tautological comparison in Support/Windows/Path.inc

Bob Haarman via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 27 16:41:18 PDT 2017


Author: inglorion
Date: Fri Oct 27 16:41:17 2017
New Revision: 316814

URL: http://llvm.org/viewvc/llvm-project?rev=316814&view=rev
Log:
[support] remove tautological comparison in Support/Windows/Path.inc

Summary:
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.

Reviewers: zturner, rnk, majnemer, compnerd

Reviewed By: zturner

Subscribers: amccarth, hiraditya, lebedev.ri, llvm-commits

Differential Revision: https://reviews.llvm.org/D39263

Modified:
    llvm/trunk/lib/Support/Windows/Path.inc

Modified: llvm/trunk/lib/Support/Windows/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Path.inc?rev=316814&r1=316813&r2=316814&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/Path.inc (original)
+++ llvm/trunk/lib/Support/Windows/Path.inc Fri Oct 27 16:41:17 2017
@@ -721,10 +721,6 @@ std::error_code setLastModificationAndAc
 
 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);




More information about the llvm-commits mailing list