summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2020-02-03 14:16:52 -0500
committerHans Wennborg <hans@chromium.org>2020-02-19 13:27:51 +0100
commit8de07c31c1aafa848f515d721e6cf065a0701e81 (patch)
tree9576685367d86c8610c902f0a842d76c1b53c824
parent3dee8be1c3fe621b9c1926658f6c0df72ce804be (diff)
downloadbcm5719-llvm-8de07c31c1aafa848f515d721e6cf065a0701e81.tar.gz
bcm5719-llvm-8de07c31c1aafa848f515d721e6cf065a0701e81.zip
Fix a -Wbitwise-conditional-parentheses warning in _LIBUNWIND_ARM_EHABI libunwind builds
``` src/UnwindCursor.hpp:1344:51: error: operator '?:' has lower precedence than '|'; '|' will be evaluated first [-Werror,-Wbitwise-conditional-parentheses] _info.flags = isSingleWordEHT ? 1 : 0 | scope32 ? 0x2 : 0; // Use enum? ~~~~~~~~~~~ ^ src/UnwindCursor.hpp:1344:51: note: place parentheses around the '|' expression to silence this warning _info.flags = isSingleWordEHT ? 1 : 0 | scope32 ? 0x2 : 0; // Use enum? ^ ( ) src/UnwindCursor.hpp:1344:51: note: place parentheses around the '?:' expression to evaluate it first _info.flags = isSingleWordEHT ? 1 : 0 | scope32 ? 0x2 : 0; // Use enum? ^ ( ) ``` But `0 |` is a no-op for either of those two interpretations, so I think what was meant here was ``` _info.flags = (isSingleWordEHT ? 1 : 0) | (scope32 ? 0x2 : 0); // Use enum? ``` Previously, if `isSingleWordEHT` was set, bit 2 would never be set. Now it is. From what I can tell, the only thing that checks these bitmask is ProcessDescriptors in Unwind-EHABI.cpp, and that only cares about bit 1, so in practice this shouldn't have much of an effect. Differential Revision: https://reviews.llvm.org/D73890 (cherry picked from commit 221c5af4e4f4a504a4d1f352dd7b76d305e56a62)
-rw-r--r--libunwind/src/UnwindCursor.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libunwind/src/UnwindCursor.hpp b/libunwind/src/UnwindCursor.hpp
index 31be8366d23..e7fb70cc571 100644
--- a/libunwind/src/UnwindCursor.hpp
+++ b/libunwind/src/UnwindCursor.hpp
@@ -1353,7 +1353,8 @@ bool UnwindCursor<A, R>::getInfoFromEHABISection(
// If the high bit is set, the exception handling table entry is inline inside
// the index table entry on the second word (aka |indexDataAddr|). Otherwise,
- // the table points at an offset in the exception handling table (section 5 EHABI).
+ // the table points at an offset in the exception handling table (section 5
+ // EHABI).
pint_t exceptionTableAddr;
uint32_t exceptionTableData;
bool isSingleWordEHT;
@@ -1452,7 +1453,7 @@ bool UnwindCursor<A, R>::getInfoFromEHABISection(
_info.unwind_info = exceptionTableAddr;
_info.lsda = lsda;
// flags is pr_cache.additional. See EHABI #7.2 for definition of bit 0.
- _info.flags = isSingleWordEHT ? 1 : 0 | scope32 ? 0x2 : 0; // Use enum?
+ _info.flags = (isSingleWordEHT ? 1 : 0) | (scope32 ? 0x2 : 0); // Use enum?
return true;
}
OpenPOWER on IntegriCloud