Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
SCRAMBLE_IN_HASH macro
  • Loading branch information
sweeneyde committed Dec 19, 2022
commit 2014fb13e87b9885e650ab0b5d22af28ddf62237
24 changes: 12 additions & 12 deletions Objects/codeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1847,20 +1847,20 @@ code_hash(PyCodeObject *co)
uhash ^= (Py_uhash_t)(H); \
uhash *= _PyHASH_MULTIPLIER; \
} while (0)
#define SCRAMBLE_IN_OR_ERR(EXPR) do { \
Py_hash_t h = (EXPR); \
if (h == -1) { \
return -1; \
} \
SCRAMBLE_IN(h); \
#define SCRAMBLE_IN_HASH(EXPR) do { \
Py_hash_t h = PyObject_Hash(EXPR); \
if (h == -1) { \
return -1; \
} \
SCRAMBLE_IN(h); \
} while (0)

SCRAMBLE_IN_OR_ERR(PyObject_Hash(co->co_name));
SCRAMBLE_IN_OR_ERR(PyObject_Hash(co->co_consts));
SCRAMBLE_IN_OR_ERR(PyObject_Hash(co->co_names));
SCRAMBLE_IN_OR_ERR(PyObject_Hash(co->co_localsplusnames));
SCRAMBLE_IN_OR_ERR(PyObject_Hash(co->co_linetable));
SCRAMBLE_IN_OR_ERR(PyObject_Hash(co->co_exceptiontable));
SCRAMBLE_IN_HASH(co->co_name);
SCRAMBLE_IN_HASH(co->co_consts);
SCRAMBLE_IN_HASH(co->co_names);
SCRAMBLE_IN_HASH(co->co_localsplusnames);
SCRAMBLE_IN_HASH(co->co_linetable);
SCRAMBLE_IN_HASH(co->co_exceptiontable);
SCRAMBLE_IN(co->co_argcount);
SCRAMBLE_IN(co->co_posonlyargcount);
SCRAMBLE_IN(co->co_kwonlyargcount);
Expand Down