summaryrefslogtreecommitdiffstats
path: root/generic/tclGetDate.y
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2024-03-15 14:14:47 (GMT)
committersebres <sebres@users.sourceforge.net>2024-03-15 14:14:47 (GMT)
commitf81c7c620816c8a89bc363903c29f338bf7d6162 (patch)
tree67c647f543ac69a49a31606c094f5c6796bd3f88 /generic/tclGetDate.y
parenta20d3aea075e2b3990de10e1637613c7278d6acc (diff)
downloadtcl-f81c7c620816c8a89bc363903c29f338bf7d6162.zip
tcl-f81c7c620816c8a89bc363903c29f338bf7d6162.tar.gz
tcl-f81c7c620816c8a89bc363903c29f338bf7d6162.tar.bz2
fixes [1f40aa83c552f597]: suppress integer-overflow trapping (atm, GCC "trapv" only) for intended pieces, avoid unexpected app-crash;
test cases (knownBug) reverted.
Diffstat (limited to 'generic/tclGetDate.y')
-rw-r--r--generic/tclGetDate.y9
1 files changed, 9 insertions, 0 deletions
diff --git a/generic/tclGetDate.y b/generic/tclGetDate.y
index 0bf16e8..b0a8f85 100644
--- a/generic/tclGetDate.y
+++ b/generic/tclGetDate.y
@@ -875,6 +875,11 @@ LookupWord(
return tID;
}
+/* int overflows may happens here (expected case) */
+#if defined(__GNUC__) || defined(__GNUG__)
+# pragma GCC optimize("no-trapv")
+#endif
+
static int
TclDatelex(
YYSTYPE* yylvalPtr,
@@ -1012,6 +1017,10 @@ TclDatelex(
} while (Count > 0);
}
}
+
+#if defined(__GNUC__) || defined(__GNUG__)
+# pragma GCC reset_options
+#endif
int
TclClockFreeScan(