diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2021-06-08 16:01:34 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-08 16:01:34 -0600 |
commit | 3e1c7167d86a2a928cdcb659094aa10bb5550c4c (patch) | |
tree | b3b071ff5636c7c5edd8d536b8732c6a2259a44c /Include/cpython/code.h | |
parent | ab36b9f83424a020fbd672f218612e6f19257a32 (diff) | |
download | cpython-git-3e1c7167d86a2a928cdcb659094aa10bb5550c4c.tar.gz |
bpo-43693: Un-revert commit f3fa63e. (#26609)
This was reverted in GH-26596 (commit 6d518bb) due to some bad memory accesses.
* Add the MAKE_CELL opcode. (gh-26396)
The memory accesses have been fixed.
https://bugs.python.org/issue43693
Diffstat (limited to 'Include/cpython/code.h')
-rw-r--r-- | Include/cpython/code.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Include/cpython/code.h b/Include/cpython/code.h index 773df7cb9a..a3db7d9d5e 100644 --- a/Include/cpython/code.h +++ b/Include/cpython/code.h @@ -2,9 +2,16 @@ # error "this header file must not be included directly" #endif +/* Each instruction in a code object is a fixed-width value, + * currently 2 bytes: 1-byte opcode + 1-byte oparg. The EXTENDED_ARG + * opcode allows for larger values but the current limit is 3 uses + * of EXTENDED_ARG (see Python/wordcode_helpers.h), for a maximum + * 32-bit value. This aligns with the note in Python/compile.c + * (compiler_addop_i_line) indicating that the max oparg value is + * 2**32 - 1, rather than INT_MAX. + */ + typedef uint16_t _Py_CODEUNIT; -// Each oparg must fit in the second half of _Py_CODEUNIT, hence 8 bits. -#define _Py_MAX_OPARG 255 #ifdef WORDS_BIGENDIAN # define _Py_OPCODE(word) ((word) >> 8) |