mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +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
|
@ -511,8 +511,12 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names,
|
|||
if (instrsize(j) > ilen) {
|
||||
goto exitUnchanged;
|
||||
}
|
||||
assert(ilen <= INT_MAX);
|
||||
/* If instrsize(j) < ilen, we'll emit EXTENDED_ARG 0 */
|
||||
if (ilen > 4) {
|
||||
/* Can only happen when PyCode_Optimize() is called with
|
||||
malformed bytecode. */
|
||||
goto exitUnchanged;
|
||||
}
|
||||
write_op_arg(codestr + h, opcode, j, (int)ilen);
|
||||
h += ilen;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue