[all-commits] [llvm/llvm-project] f3e8f9: [ADT] Fix itostr handling of min int64_t value

RoboTux via All-commits all-commits at lists.llvm.org
Fri Jun 19 10:39:10 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f3e8f9617365f129a0e9876fc3d38f15d6f2d4fd
      https://github.com/llvm/llvm-project/commit/f3e8f9617365f129a0e9876fc3d38f15d6f2d4fd
  Author: Thomas Preud'homme <thomasp at graphcore.ai>
  Date:   2020-06-19 (Fri, 19 Jun 2020)

  Changed paths:
    M llvm/include/llvm/ADT/StringExtras.h

  Log Message:
  -----------
  [ADT] Fix itostr handling of min int64_t value

Summary:
UBSan buildbot caught an undefined behavior in itostr with INT64_MIN.
The negation cannot be represented in the promoted operand (long long).
Negation is well defined on unsigned value though so this commit does
the negation after the static cast.

Reviewers: jhenderson, chandlerc, lattner

Reviewed By: lattner

Subscribers: dexonsmith, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82200




More information about the All-commits mailing list