Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Crash on compilation of invalid AST involving walrus #109351

Closed
Labels
type-crashA hard crash of the interpreter, possibly with a core dump
@JelleZijlstra

Description

@JelleZijlstra

Running this file:

import astm = ast.Module(    body=[        ast.Expr(            value=ast.ListComp(                elt=ast.NamedExpr(                    target=ast.Constant(value=1),                    value=ast.Constant(value=3),                ),                generators=[                    ast.comprehension(                        target=ast.Name(id="x", ctx=ast.Store()),                        iter=ast.Name(id="y", ctx=ast.Load()),                        ifs=[],                        is_async=0,                    )                ],            )        )    ],    type_ignores=[],)compile(ast.fix_missing_locations(m), "<file>", "exec")

Causes:

% ./python.exe namedexpr.py Assertion failed: (e->kind == Name_kind), function symtable_extend_namedexpr_scope, file symtable.c, line 1877.zsh: abort      ./python.exe namedexpr.py

This is on a debug build; on a release build presumably it will segfault or trigger UB somewhere.

I'll have a fix soon.

On 3.11 the reproducer instead fails withTypeError: '<' not supported between instances of 'int' and 'str' for me. Not sure what's up with that; the code that should trigger the crash is the same on 3.11 and main.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp