[Lldb-commits] [PATCH] D131312: [LLDB][NFC] Fix suspicious bitwise expression in PrintBTEntry()

Will Hawkins via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sat Aug 6 13:29:10 PDT 2022


hawkinsw added inline comments.


================
Comment at: lldb/tools/intel-features/intel-mpx/cli-wrapper-mpxtable.cpp:66
 
-  if ((lbound == one_cmpl64 || one_cmpl32) && ubound == 0) {
     result.Printf("Null bounds on map: pointer value = 0x%" PRIu64 "\n", value);
----------------
According to https://en.cppreference.com/w/cpp/language/operator_precedence, I would read the left operand of the `&&` as 

1. The `==` has higher precedence than `||` so, `b = (lbound == one_compl64)`
2. `b || one_cmpl32`

which does not seem like what the original author intended. I absolutely think that the fix is correct, but I just wanted to get everyone's feedback on whether this seems like more than just a "suspicious bitwise expression" (and more like a "mistaken bitwise expression").

All that said, I could be completely, 100% wrong. And, if I am, feel free to ignore me!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131312/new/

https://reviews.llvm.org/D131312



More information about the lldb-commits mailing list