◐ Shell
clean mode source ↗

Segfault when compiling a nested AST

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