mirror of
https://github.com/python/cpython.git
synced 2026-06-05 01:10:53 +00:00
gh-148871: Add CONSTANT_EMPTY_TUPLE to LOAD_COMMON_CONSTANT (GH-149688)
This commit is contained in:
parent
c35b0f2b62
commit
f2fa291db8
8 changed files with 20 additions and 9 deletions
|
|
@ -1468,6 +1468,10 @@ maybe_instr_make_load_common_const(cfg_instr *instr, PyObject *newconst)
|
|||
&& PyUnicode_GET_LENGTH(newconst) == 0) {
|
||||
oparg = CONSTANT_EMPTY_STR;
|
||||
}
|
||||
else if (PyTuple_CheckExact(newconst)
|
||||
&& PyTuple_GET_SIZE(newconst) == 0) {
|
||||
oparg = CONSTANT_EMPTY_TUPLE;
|
||||
}
|
||||
else if (PyLong_CheckExact(newconst)) {
|
||||
int overflow;
|
||||
long val = PyLong_AsLongAndOverflow(newconst, &overflow);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue