Skip to content

Segfault when compiling a nested AST #4862

Closed

Description

@xiaxinmeng

The code creates a nested abstract syntax tree for a double negation operation using the ast module and compiles and evaluates it, resulting in a segmentation fault.

import ast
d = e = ast.UnaryOp(op=ast.Not(), lineno=0, col_offset=0)
d.operand = e
compile(ast.Expression(d), "<test>", "eval")

Crash message:
Segmentation fault (core dumped)

Environment:
Ubuntu 18.04
rustpython v0.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-compilerArea: compilerC-bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions