Skip to content

_testinternalcapi.compiler_codegen segfaults on bad input #115376

@iritkatriel

Description

@iritkatriel

This segfaults:

import ast
from _testinternalcapi import compiler_codegen

a = ast.parse("return 42", "my_file.py", "exec")
compiler_codegen(a, "my_file.py", 0)

Expected SyntaxError (return not in function).

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions