From 6a5e34f9b7eb2e3f06dff38e3ae02dec6c6ece3f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 30 Nov 2021 21:46:16 +0000 Subject: windows-2016 will no longer be supported by GitHub actions --- .github/workflows/win-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml index 637ca7e..8e9f2d5 100644 --- a/.github/workflows/win-build.yml +++ b/.github/workflows/win-build.yml @@ -2,7 +2,7 @@ name: Windows on: [push] jobs: msvc: - runs-on: windows-2016 + runs-on: windows-2019 defaults: run: shell: powershell @@ -41,7 +41,7 @@ jobs: env: ERROR_ON_FAILURES: 1 gcc: - runs-on: windows-2016 + runs-on: windows-2019 defaults: run: shell: bash -- cgit v0.12 From 5bf0f340142edcd64278647c758782961c1a76c8 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 1 Dec 2021 09:58:10 +0000 Subject: Fix winFCmd-19.5 testcase on GitHub actions: Tcl 8.5 is known not to be able to handle too long filenames (8.6 can!) --- tests/winFCmd.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/winFCmd.test b/tests/winFCmd.test index 6256fda..291361c 100644 --- a/tests/winFCmd.test +++ b/tests/winFCmd.test @@ -1188,7 +1188,7 @@ test winFCmd-19.4 {Windows extended path names} -constraints nt -setup { catch {file delete $tmpfile} } -result [list 0 {}] test winFCmd-19.5 {Windows extended path names} -constraints nt -setup { - set tmpfile [file join $::env(TEMP) tcl[string repeat x 248].tmp] + set tmpfile [file join $::env(TEMP) tcl[string repeat x 200].tmp] set tmpfile [file normalize $tmpfile] } -body { list [catch { -- cgit v0.12 From 3ad14e6b9a825cc010e8a15687eb872978f10171 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 7 Dec 2021 18:05:04 +0000 Subject: Fix [cea2c63928]: Address -fsanitize=shift-exponent complaints in TclParseNumber() --- generic/tclStrToD.c | 85 +++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 69 insertions(+), 16 deletions(-) diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c index 35848f7..372fe77 100644 --- a/generic/tclStrToD.c +++ b/generic/tclStrToD.c @@ -694,9 +694,9 @@ TclParseNumber( if (!octalSignificandOverflow) { /* - * Shifting by more bits than are in the value being - * shifted is at least de facto nonportable. Check for - * too large shifts first. + * Shifting by as many or more bits than are in the + * value being shifted is undefined behavior. Check + * for too large shifts first. */ if ((octalSignificandWide != 0) @@ -710,8 +710,17 @@ TclParseNumber( } } if (!octalSignificandOverflow) { - octalSignificandWide = - (octalSignificandWide << shift) + (c - '0'); + /* + * When the significand is 0, it is possible for the + * amount to be shifted to equal or exceed the width + * of the significand. Do not shift when the + * significand is 0 to avoid undefined behavior. + */ + + if (octalSignificandWide != 0) { + octalSignificandWide <<= shift; + } + octalSignificandWide += c - '0'; } else { mp_mul_2d(&octalSignificandBig, shift, &octalSignificandBig); @@ -813,9 +822,9 @@ TclParseNumber( shift = 4 * (numTrailZeros + 1); if (!significandOverflow) { /* - * Shifting by more bits than are in the value being - * shifted is at least de facto nonportable. Check for too - * large shifts first. + * Shifting by as many or more bits than are in the + * value being shifted is undefined behavior. Check + * for too large shifts first. */ if (significandWide != 0 && @@ -827,7 +836,17 @@ TclParseNumber( } } if (!significandOverflow) { - significandWide = (significandWide << shift) + d; + /* + * When the significand is 0, it is possible for the + * amount to be shifted to equal or exceed the width + * of the significand. Do not shift when the + * significand is 0 to avoid undefined behavior. + */ + + if (significandWide != 0) { + significandWide <<= shift; + } + significandWide += d; } else { mp_mul_2d(&significandBig, shift, &significandBig); mp_add_d(&significandBig, (mp_digit) d, &significandBig); @@ -855,9 +874,9 @@ TclParseNumber( shift = numTrailZeros + 1; if (!significandOverflow) { /* - * Shifting by more bits than are in the value being - * shifted is at least de facto nonportable. Check for too - * large shifts first. + * Shifting by as many or more bits than are in the + * value being shifted is undefined behavior. Check + * for too large shifts first. */ if (significandWide != 0 && @@ -869,7 +888,17 @@ TclParseNumber( } } if (!significandOverflow) { - significandWide = (significandWide << shift) + 1; + /* + * When the significand is 0, it is possible for the + * amount to be shifted to equal or exceed the width + * of the significand. Do not shift when the + * significand is 0 to avoid undefined behavior. + */ + + if (significandWide != 0) { + significandWide <<= shift; + } + significandWide += 1; } else { mp_mul_2d(&significandBig, shift, &significandBig); mp_add_d(&significandBig, (mp_digit) 1, &significandBig); @@ -1202,7 +1231,15 @@ TclParseNumber( } if (shift) { if (!significandOverflow) { - significandWide <<= shift; + /* + * When the significand is 0, it is possible for the + * amount to be shifted to equal or exceed the width + * of the significand. Do not shift when the + * significand is 0 to avoid undefined behavior. + */ + if (significandWide != 0) { + significandWide <<= shift; + } } else { mp_mul_2d(&significandBig, shift, &significandBig); } @@ -1223,7 +1260,15 @@ TclParseNumber( } if (shift) { if (!significandOverflow) { - significandWide <<= shift; + /* + * When the significand is 0, it is possible for the + * amount to be shifted to equal or exceed the width + * of the significand. Do not shift when the + * significand is 0 to avoid undefined behavior. + */ + if (significandWide != 0) { + significandWide <<= shift; + } } else { mp_mul_2d(&significandBig, shift, &significandBig); } @@ -1245,7 +1290,15 @@ TclParseNumber( } if (shift) { if (!octalSignificandOverflow) { - octalSignificandWide <<= shift; + /* + * When the significand is 0, it is possible for the + * amount to be shifted to equal or exceed the width + * of the significand. Do not shift when the + * significand is 0 to avoid undefined behavior. + */ + if (octalSignificandWide != 0) { + octalSignificandWide <<= shift; + } } else { mp_mul_2d(&octalSignificandBig, shift, &octalSignificandBig); -- cgit v0.12