[clang] Avoid printing overly large integer. (PR #75902)

Yueh-Shun Li via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 5 07:20:13 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>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/75902 at github.com>


================
@@ -17132,6 +17132,10 @@ static bool ConvertAPValueToString(const APValue &V, QualType T,
         case BuiltinType::WChar_U: {
           unsigned TyWidth = Context.getIntWidth(T);
           assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
+          if (V.getInt() > std::numeric_limits<uint64_t>::max() ||
----------------
ShamrockLee wrote:

> thanks for letting me know! I have moved the code overthere, however it looks like there are some failed tests, is it because of my code which causes the error?

It is because the conditional clause should be *above* the integer printing in question.

https://github.com/llvm/llvm-project/pull/75902


More information about the cfe-commits mailing list