-
- Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixestopic-typingtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
Description
Bug report
Bug description:
The code for the following AST is:
type foo['x'] = Callablecompiling the AST for the given code results in a segmentation fault
from ast import * m = Module( body=[ TypeAlias( name=Subscript( value=Name(id="foo", ctx=Load()), slice=Constant(value="x"), ctx=Store(), ), type_params=[], value=Name(id="Callable", ctx=Load()), ) ], type_ignores=[], ) compile(fix_missing_locations(m), "<file>", "exec")output (Python 3.12.0rc2+):
fish: Job 1, 'venv3.12/bin/python bug.py' terminated by signal SIGSEGV (Adressbereichsfehler) Compiling the code gives the correct syntax error.
compile("type foo['x'] = Callable","<file>","exec")output (Python 3.12.0rc2+):
Traceback (most recent call last): File "/home/frank/projects/executing/bug.py", line 1, in <module> compile("type foo['x'] = Callable","<file>","exec") File "<file>", line 1 type foo['x'] = Callable ^^^ SyntaxError: invalid syntax CPython versions tested on:
3.12
Operating systems tested on:
No response
Linked PRs
Metadata
Metadata
Assignees
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixestopic-typingtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump