Skip to content

Commit 4602616

Browse files
ci fixes for wasl and c-global checker
1 parent 9eec989 commit 4602616

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

Modules/_testinternalcapi.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,11 +1913,13 @@ dict_index_bytes_for_keys(PyDictKeysObject *keys)
19131913
if (index_shift == 1) {
19141914
return 2;
19151915
}
1916-
#if SIZEOF_VOID_P > 4
19171916
if (index_shift == 3) {
1917+
#if SIZEOF_VOID_P > 4
19181918
return 8;
1919-
}
19201919
#endif
1920+
/* Py_EMPTY_KEYS uses dk_log2_index_bytes=3 even on 32-bit builds. */
1921+
return 4;
1922+
}
19211923
assert(index_shift == 2);
19221924
return 4;
19231925
}

Objects/dictobject.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -648,9 +648,6 @@ static _PyDict_EmptyKeysStorage empty_keys_storage = {
648648
}
649649
};
650650

651-
static_assert(offsetof(_PyDict_EmptyKeysStorage, keys) == 8,
652-
"empty_keys_storage layout mismatch");
653-
654651
#define Py_EMPTY_KEYS (&empty_keys_storage.keys)
655652

656653
/* Uncomment to check the dict content in _PyDict_CheckConsistency() */
@@ -665,6 +662,7 @@ static_assert(offsetof(_PyDict_EmptyKeysStorage, keys) == 8,
665662
static inline int
666663
get_index_from_order(PyDictObject *mp, Py_ssize_t i)
667664
{
665+
Py_BUILD_ASSERT(offsetof(_PyDict_EmptyKeysStorage, keys) == 8);
668666
assert(mp->ma_used <= SHARED_KEYS_MAX_SIZE);
669667
assert(i < mp->ma_values->size);
670668
uint8_t *array = get_insertion_order_array(mp->ma_values);

0 commit comments

Comments
 (0)