Skip to content

Commit cceb8db

Browse files
committed
fixup
1 parent 34535ba commit cceb8db

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

Programs/test_frozenmain.h

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/specialize.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,7 +1639,7 @@ specialize_class_call(PyObject *callable, _Py_CODEUNIT *instr, int nargs)
16391639
assert(PyType_Check(callable));
16401640
PyTypeObject *tp = _PyType_CAST(callable);
16411641
if (tp->tp_flags & Py_TPFLAGS_IMMUTABLETYPE) {
1642-
if (nargs == 1) {
1642+
if (nargs == 1 && CALL_ARGCOUNT(instr->op.arg) == 1) {
16431643
if (tp == &PyUnicode_Type) {
16441644
specialize(instr, CALL_STR_1);
16451645
return 0;
@@ -1707,7 +1707,8 @@ specialize_method_descriptor(PyMethodDescrObject *descr, PyObject *self_or_null,
17071707
}
17081708
PyInterpreterState *interp = _PyInterpreterState_GET();
17091709
PyObject *list_append = interp->callable_cache.list_append;
1710-
if ((PyObject *)descr == list_append) {
1710+
if ((PyObject *)descr == list_append &&
1711+
CALL_ARGCOUNT(instr->op.arg) == 1) {
17111712
assert(self_or_null != NULL);
17121713
if (PyList_CheckExact(self_or_null)) {
17131714
specialize(instr, CALL_LIST_APPEND);

0 commit comments

Comments
 (0)