[llvm] r345543 - Add parens to fix incorrect assert check.

Erich Keane via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 29 14:21:55 PDT 2018


Author: erichkeane
Date: Mon Oct 29 14:21:55 2018
New Revision: 345543

URL: http://llvm.org/viewvc/llvm-project?rev=345543&view=rev
Log:
Add parens to fix incorrect assert check.

&& has higher priority than ||, so this assert works really oddly. Add
parens to match the programmer's intent.

Change-Id: I3abe1361ee0694462190c5015779db664012f3d4

Modified:
    llvm/trunk/lib/Support/VirtualFileSystem.cpp

Modified: llvm/trunk/lib/Support/VirtualFileSystem.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/VirtualFileSystem.cpp?rev=345543&r1=345542&r2=345543&view=diff
==============================================================================
--- llvm/trunk/lib/Support/VirtualFileSystem.cpp (original)
+++ llvm/trunk/lib/Support/VirtualFileSystem.cpp Mon Oct 29 14:21:55 2018
@@ -2118,7 +2118,7 @@ std::error_code VFSFromYamlDirIterImpl::
 }
 
 std::error_code VFSFromYamlDirIterImpl::incrementContent(bool IsFirstTime) {
-  assert(IsFirstTime || Current != End && "cannot iterate past end");
+  assert((IsFirstTime || Current != End) && "cannot iterate past end");
   if (!IsFirstTime)
     ++Current;
   while (Current != End) {




More information about the llvm-commits mailing list