[all-commits] [llvm/llvm-project] 5ce83c: [libc] fix strtointeger behavior on max values

michaelrj-google via All-commits all-commits at lists.llvm.org
Wed Mar 29 13:02:54 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5ce83caba59d7c470e1a12a8d6ef63c33d98e177
      https://github.com/llvm/llvm-project/commit/5ce83caba59d7c470e1a12a8d6ef63c33d98e177
  Author: Michael Jones <michaelrj at google.com>
  Date:   2023-03-29 (Wed, 29 Mar 2023)

  Changed paths:
    M libc/src/__support/str_to_integer.h
    M libc/test/src/stdlib/StrtolTest.h

  Log Message:
  -----------
  [libc] fix strtointeger behavior on max values

Previously the check to just return MAX or MIN used the caclulated
number being the maximum absolute value. This was right in every case
except for an unsigned conversion being passed its maximum value with a
negative sign on the front. This should return -MAX, but was returning
just MAX.

Reviewed By: lntue

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




More information about the All-commits mailing list