[pypy-issue] [issue806] crash when running Python code

Albert Zeyer tracker at bugs.pypy.org
Fri Jul 22 15:15:57 CEST 2011


New submission from Albert Zeyer <albzey at gmail.com>:

Code:

```
import ast

globalsDict = {}

fAst = ast.FunctionDef(
	name="foo",
	args=ast.arguments(
		args=[], vararg=None, kwarg=None, defaults=[],
		kwonlyargs=[], kw_defaults=[]),
	body=[], decorator_list=[])

exprAst = ast.Interactive(body=[fAst])
ast.fix_missing_locations(exprAst)
compiled = compile(exprAst, "<foo>", "single")
eval(compiled, globalsDict, globalsDict)

print(globalsDict["foo"])
```

Also CPython 2.6, 2.7, 3.0 and 3.2 crash on this. They crash in the 
PyAST_Compile function.

----------
messages: 2842
nosy: albert, pypy-issue
priority: critical
release: 1.5
status: unread
title: crash when running Python code

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue806>
________________________________________


More information about the pypy-issue mailing list