Overview
| Artifact ID: | 45f0f2a9ec54fb3867e32d5f51a6f0152d9d21c348d4df6750d557fb09bbb1bb |
|---|---|
| Ticket: | 00655c867eabd57ac3acd93bffe2f93799c12c89
ClockGetdatefieldsObjCmd(): avoid signed integer overflow and platform-dependent behavior |
| User & Date: | jan.nijtmans on 2023-09-20 13:37:47 |
Changes
- closer changed to: "nobody"
- icomment:
The new testcase fails in a OPTS=static,msvcrt build in Visual Studio, passes in all other configurations. <pre> clock.test ==== clock-7.10 Julian Day, negative amount FAILED ==== Contents of test case: # Note: %J does not accept negative input; # add negative amounts to Julian day 0 instead set s0 [clock scan 0 -format %J -gmt true] set J0 [scan [clock format $s0 -format %J -gmt true] %lld] set s0m1d [clock add $s0 -1 days] set s0m24h [clock add $s0 -24 hours] set J0m24h [scan [clock format $s0m24h -format %J -gmt true] %lld] set s0m1s [clock add $s0 -1 seconds] set J0m1s [scan [clock format $s0m1s -format %J -gmt true] %lld] list $s0m1d $s0m24h $J0m24h $s0m1s $J0m1s $s0 $J0 [::tcl::mathop::== $s0m1d $s0m24h] [::tcl::mathop::== $J0m24h $J0m1s] ---- Test generated error; Return code was: 1 ---- Return code should have been one of: 0 2 ---- errorInfo: localtime failed (clock value may be too large/small to represent) while executing "return -options $opts $result" (procedure "::tcl::clock::add" line 98) invoked from within "clock add $s0 -1 days" ("uplevel" body line 6) invoked from within "uplevel 1 $script" ---- errorCode: CLOCK localtimeFailed ==== clock-7.10 FAILED cmdAH.test </pre> - login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- status changed to: "Pending"