aboutsummaryrefslogtreecommitdiff
path: root/libcxxabi
diff options
context:
space:
mode:
authorluolent <56246516+luolent@users.noreply.github.com>2024-05-04 20:38:45 +0300
committerGitHub <noreply@github.com>2024-05-04 18:38:45 +0100
commita98a6e95be1be9a5c28da15b4d19a6f39872461d (patch)
tree414af1d920cc1be91c79ff23fded3b4cdf291faa /libcxxabi
parent028f1b078193b9120ddb441808521b6bd6eaed0e (diff)
downloadllvm-a98a6e95be1be9a5c28da15b4d19a6f39872461d.zip
llvm-a98a6e95be1be9a5c28da15b4d19a6f39872461d.tar.gz
llvm-a98a6e95be1be9a5c28da15b4d19a6f39872461d.tar.bz2
Add clarifying parenthesis around non-trivial conditions in ternary expressions. (#90391)
Fixes [#85868](https://github.com/llvm/llvm-project/issues/85868) Parenthesis are added as requested on ternary operators with non trivial conditions. I used this [precedence table](https://en.cppreference.com/w/cpp/language/operator_precedence) for reference, to make sure we get the expected behavior on each change.
Diffstat (limited to 'libcxxabi')
-rw-r--r--libcxxabi/src/cxa_personality.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/libcxxabi/src/cxa_personality.cpp b/libcxxabi/src/cxa_personality.cpp
index 4b6c4ed..d95d781 100644
--- a/libcxxabi/src/cxa_personality.cpp
+++ b/libcxxabi/src/cxa_personality.cpp
@@ -717,9 +717,7 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,
if (actionEntry == 0)
{
// Found a cleanup
- results.reason = actions & _UA_SEARCH_PHASE
- ? _URC_CONTINUE_UNWIND
- : _URC_HANDLER_FOUND;
+ results.reason = (actions & _UA_SEARCH_PHASE) ? _URC_CONTINUE_UNWIND : _URC_HANDLER_FOUND;
return;
}
// Convert 1-based byte offset into