mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
bpo-38249: Expand Py_UNREACHABLE() to __builtin_unreachable() in the release mode. (GH-16329)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
6d0ee60740
commit
eebaa9bfc5
8 changed files with 39 additions and 15 deletions
|
|
@ -746,7 +746,7 @@ _PyTime_GetSystemClock(void)
|
|||
_PyTime_t t;
|
||||
if (pygettimeofday(&t, NULL, 0) < 0) {
|
||||
/* should not happen, _PyTime_Init() checked the clock at startup */
|
||||
Py_UNREACHABLE();
|
||||
Py_FatalError("pygettimeofday() failed");
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
|
@ -776,7 +776,7 @@ pymonotonic(_PyTime_t *tp, _Py_clock_info_t *info, int raise)
|
|||
return -1;
|
||||
}
|
||||
/* Hello, time traveler! */
|
||||
Py_UNREACHABLE();
|
||||
Py_FatalError("pymonotonic: integer overflow");
|
||||
}
|
||||
*tp = t * MS_TO_NS;
|
||||
|
||||
|
|
@ -918,7 +918,7 @@ _PyTime_GetMonotonicClock(void)
|
|||
if (pymonotonic(&t, NULL, 0) < 0) {
|
||||
/* should not happen, _PyTime_Init() checked that monotonic clock at
|
||||
startup */
|
||||
Py_UNREACHABLE();
|
||||
Py_FatalError("pymonotonic() failed");
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
|
@ -1019,7 +1019,7 @@ _PyTime_GetPerfCounter(void)
|
|||
{
|
||||
_PyTime_t t;
|
||||
if (_PyTime_GetPerfCounterWithInfo(&t, NULL)) {
|
||||
Py_UNREACHABLE();
|
||||
Py_FatalError("_PyTime_GetPerfCounterWithInfo() failed");
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue