[all-commits] [llvm/llvm-project] 034f56: Changes to mktime to handle invalid dates, overflo...

rtenneti-google via All-commits all-commits at lists.llvm.org
Mon Feb 22 18:38:15 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 034f5629256c810ecf4805911e3fe407e562f3b7
      https://github.com/llvm/llvm-project/commit/034f5629256c810ecf4805911e3fe407e562f3b7
  Author: Raman Tenneti <rtenneti at google.com>
  Date:   2021-02-22 (Mon, 22 Feb 2021)

  Changed paths:
    M libc/src/time/CMakeLists.txt
    M libc/src/time/mktime.cpp
    A libc/src/time/time_utils.h
    M libc/test/src/time/CMakeLists.txt
    A libc/test/src/time/TmMatcher.h
    M libc/test/src/time/mktime_test.cpp

  Log Message:
  -----------
  Changes to mktime to handle invalid dates, overflow and underflow andcalculating the correct date and thenumber of seconds even if invalid datesare passed as arguments.

Added tests for invalid dates like the following
  Date 1970-01-01 00:00:-1 is treated as 1969-12-31 23:59:59 and seconds
  are returned for the modified date.

Tested the code by doing ninja check-libc (and cmake).

Reviewed By: sivachandra, rtenneti

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




More information about the All-commits mailing list