diff options
| author | Victor Stinner <vstinner@python.org> | 2022-06-20 16:04:52 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-20 16:04:52 +0200 |
| commit | 7ad6f74fcf9db1ccfeaf0986064870d8d3887300 (patch) | |
| tree | 2b140e0e4fdb3b58379887bab6ff68ade5c67c60 /Include/cpython/code.h | |
| parent | 61f24e7885bed096b5d7f75aff13c1001994b35a (diff) | |
| download | cpython-git-7ad6f74fcf9db1ccfeaf0986064870d8d3887300.tar.gz | |
gh-87347: Add parenthesis around macro arguments (#93915)
Add unit test on Py_MEMBER_SIZE() and some other macros.
Diffstat (limited to 'Include/cpython/code.h')
| -rw-r--r-- | Include/cpython/code.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Include/cpython/code.h b/Include/cpython/code.h index 238bf9450a..ebc0df9323 100644 --- a/Include/cpython/code.h +++ b/Include/cpython/code.h @@ -29,7 +29,8 @@ typedef uint16_t _Py_CODEUNIT; #endif // Use "unsigned char" instead of "uint8_t" here to avoid illegal aliasing: -#define _Py_SET_OPCODE(word, opcode) (((unsigned char *)&(word))[0] = (opcode)) +#define _Py_SET_OPCODE(word, opcode) \ + do { ((unsigned char *)&(word))[0] = (opcode); } while (0) // To avoid repeating ourselves in deepfreeze.py, all PyCodeObject members are // defined in this macro: |
