mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-45829: Check __getitem__
's version for overflow before specializing (GH-30129)
* Check __getitem__'s version for overflow. * Use SPEC_FAIL_OUT_OF_VERSIONS instead
This commit is contained in:
parent
c5d18a5014
commit
62a8a0c522
1 changed files with 1 additions and 1 deletions
|
@ -1187,7 +1187,7 @@ _Py_Specialize_BinarySubscr(
|
|||
assert(cls->tp_version_tag != 0);
|
||||
cache0->version = cls->tp_version_tag;
|
||||
int version = _PyFunction_GetVersionForCurrentState(func);
|
||||
if (version == 0) {
|
||||
if (version == 0 || version != (uint16_t)version) {
|
||||
SPECIALIZATION_FAIL(BINARY_SUBSCR, SPEC_FAIL_OUT_OF_VERSIONS);
|
||||
goto fail;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue