[PATCH] D109217: [llvm-dwarfdump] Fix unsigned overflow when calculating stats

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 11 10:01:27 PDT 2021


aprantl accepted this revision.
aprantl added a comment.
This revision is now accepted and ready to land.

Ok. Works for me.



================
Comment at: llvm/tools/llvm-dwarfdump/Statistics.cpp:53
+    if (Value != UINT64_MAX) {
+      if (Value < UINT64_MAX - Value_)
+        Value += Value_;
----------------
https://en.cppreference.com/w/cpp/types/numeric_limits/max ?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109217/new/

https://reviews.llvm.org/D109217



More information about the llvm-commits mailing list