File tree 2 files changed +499
-100
lines changed
Filter options
2 files changed +499
-100
lines changed
Original file line number Diff line number Diff line change @@ -210,6 +210,8 @@ static inline PyDictUnicodeEntry* DK_UNICODE_ENTRIES(PyDictKeysObject *dk) {
210
210
#define DICT_VERSION_INCREMENT (1 << (DICT_MAX_WATCHERS + DICT_WATCHED_MUTATION_BITS))
211
211
#define DICT_WATCHER_MASK ((1 << DICT_MAX_WATCHERS) - 1)
212
212
213
+ #define DICT_VALUES_SIZE (values ) ((uint8_t *)values)[-1]
214
+
213
215
#ifdef Py_GIL_DISABLED
214
216
#define DICT_NEXT_VERSION (INTERP ) \
215
217
(_Py_atomic_add_uint64(&(INTERP)->dict_state.global_version, DICT_VERSION_INCREMENT) + DICT_VERSION_INCREMENT)
@@ -255,7 +257,7 @@ _PyDictValues_AddToInsertionOrder(PyDictValues *values, Py_ssize_t ix)
255
257
assert (ix < SHARED_KEYS_MAX_SIZE );
256
258
uint8_t * size_ptr = ((uint8_t * )values )- 2 ;
257
259
int size = * size_ptr ;
258
- assert (size + 2 < (( uint8_t * ) values )[ -1 ] );
260
+ assert (size + 2 < DICT_VALUES_SIZE ( values ));
259
261
size ++ ;
260
262
size_ptr [- size ] = (uint8_t )ix ;
261
263
* size_ptr = size ;
You can’t perform that action at this time.
0 commit comments