[clang] Avoid printing overly large integer. (PR #75902)
Yueh-Shun Li via cfe-commits
cfe-commits at lists.llvm.org
Sat Feb 10 16:24:07 PST 2024
=?utf-8?q?“Nhat?= <nhat7203 at gmail.com>,
=?utf-8?q?“Nhat?= <nhat7203 at gmail.com>,
=?utf-8?q?“Nhat?= <nhat7203 at gmail.com>,
=?utf-8?q?“Nhat?= <nhat7203 at gmail.com>,
=?utf-8?q?“Nhat?= <nhat7203 at gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/75902 at github.com>
================
@@ -17146,7 +17146,13 @@ static bool ConvertAPValueToString(const APValue &V, QualType T,
break;
}
}
- V.getInt().toString(Str);
+ if (V.getInt() > std::numeric_limits<uint64_t>::max() ||
+ V.getInt() < std::numeric_limits<int64_t>::min()) {
+ return false;
----------------
ShamrockLee wrote:
```suggestion
```
https://github.com/llvm/llvm-project/pull/75902
More information about the cfe-commits
mailing list