mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-14 06:37:33 +00:00
avoid undef behavior on minint, fixing PR7783.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110114 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3bababf880
commit
e211cd83f0
@ -143,9 +143,10 @@ raw_ostream &raw_ostream::operator<<(unsigned long long N) {
|
||||
}
|
||||
|
||||
raw_ostream &raw_ostream::operator<<(long long N) {
|
||||
if (N < 0) {
|
||||
if (N < 0) {
|
||||
*this << '-';
|
||||
N = -N;
|
||||
// Avoid undefined behavior on INT64_MIN with a cast.
|
||||
N = -(unsigned long long)N;
|
||||
}
|
||||
|
||||
return this->operator<<(static_cast<unsigned long long>(N));
|
||||
|
Loading…
x
Reference in New Issue
Block a user