mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
bpo-46841: Add a _Py_SET_OPCODE macro (GH-31780)
This commit is contained in:
parent
882d8096c2
commit
a89c29fbcc
3 changed files with 69 additions and 81 deletions
|
|
@ -23,6 +23,9 @@ typedef uint16_t _Py_CODEUNIT;
|
|||
# define _Py_MAKECODEUNIT(opcode, oparg) ((opcode)|((oparg)<<8))
|
||||
#endif
|
||||
|
||||
// Use "unsigned char" instead of "uint8_t" here to avoid illegal aliasing:
|
||||
#define _Py_SET_OPCODE(word, opcode) (((unsigned char *)&(word))[0] = (opcode))
|
||||
|
||||
|
||||
/* Bytecode object */
|
||||
struct PyCodeObject {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue