Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 2 Include/internal/pycore_uop_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions 13 Lib/test/test_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,19 @@ def __init__(self, obj):
Type(i)
self.assertEqual(calls, 100)

def test_specialization_class_call_doesnt_crash(self):
# gh-123185

class Foo:
def __init__(self, arg):
pass

for _ in range(8):
try:
Foo()
except:
pass


from _testinternalcapi import has_inline_values

Expand Down
6 changes: 5 additions & 1 deletion 6 Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -3584,8 +3584,12 @@ dummy_func(
args[-1] = self;
init_frame = _PyEvalFramePushAndInit(
tstate, init_func, NULL, args-1, oparg+1, NULL, shim);
frame->return_offset = 1 + INLINE_CACHE_ENTRIES_CALL;
SYNC_SP();
if (init_frame == NULL) {
_PyEval_FrameClearAndPop(tstate, shim);
ERROR_NO_POP();
}
frame->return_offset = 1 + INLINE_CACHE_ENTRIES_CALL;
/* Account for pushing the extra frame.
* We don't check recursion depth here,
* as it will be checked after start_frame */
Expand Down
6 changes: 5 additions & 1 deletion 6 Python/executor_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion 6 Python/generated_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.