Batuhan <batuhanosmantask...@gmail.com> added the comment:
We can probably implement something like this to prevent this happening diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index daac0966f5..f9da52da7f 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -559,6 +559,11 @@ class Obj2ModVisitor(PickleVisitor): self.emit("asdl_seq_SET(%s, i, val);" % field.name, depth+2) self.emit("}", depth+1) else: + self.emit("if (obj == tmp) {", depth+1) + self.emit("PyErr_SetString(PyExc_RuntimeError, \"Recursing fields " + "are not supported for AST nodes.\");", depth+2, reflow=False) + self.emit("goto failed;", depth+2) + self.emit("}", depth+1) self.emit("res = obj2ast_%s(tmp, &%s, arena);" % (field.type, field.name), depth+1) self.emit("if (res != 0) goto failed;", depth+1) ---------- nosy: +BTaskaya _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue11105> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com