[flang-commits] [flang] [flang] Avoid left shifts of negative signed values (PR #84786)
Krzysztof Parzyszek via flang-commits
flang-commits at lists.llvm.org
Mon Mar 11 09:36:41 PDT 2024
================
@@ -150,7 +150,10 @@ class Integer {
}
}
} else {
- INT signExtension{-(n < 0)};
+ // Avoid left shifts of negative signed values (that's an undefined
+ // behavior in C++).
+ auto signExtension = std::make_unsigned_t<INT>(n < 0);
----------------
kparzysz wrote:
Done
https://github.com/llvm/llvm-project/pull/84786
More information about the flang-commits
mailing list