[LLDB][NFC] Fix suspicious bitwise expression in PrintBTEntry()
authorSlava Gurevich <sgurevich@gmail.com>
Sat, 6 Aug 2022 04:27:28 +0000 (21:27 -0700)
committerSlava Gurevich <sgurevich@gmail.com>
Mon, 8 Aug 2022 16:04:22 +0000 (09:04 -0700)
Current application of bitwise-OR to a binary mask always results in True, which seems
inconsistent with the intent of the statement, a likely typo.

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

lldb/tools/intel-features/intel-mpx/cli-wrapper-mpxtable.cpp

index b19d8b7..de6d500 100644 (file)
@@ -63,7 +63,7 @@ static void PrintBTEntry(lldb::addr_t lbound, lldb::addr_t ubound,
   const lldb::addr_t one_cmpl64 = ~((lldb::addr_t)0);
   const lldb::addr_t one_cmpl32 = ~((uint32_t)0);
 
-  if ((lbound == one_cmpl64 || one_cmpl32) && ubound == 0) {
+  if ((lbound == one_cmpl64 || lbound == one_cmpl32) && ubound == 0) {
     result.Printf("Null bounds on map: pointer value = 0x%" PRIu64 "\n", value);
   } else {
     result.Printf("    lbound = 0x%" PRIu64 ",", lbound);