This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author BTaskaya
Recipients BTaskaya, belopolsky, benjamin.peterson, eric.snow, georg.brandl, gregory.p.smith, meador.inge
Date 2019-12-28.17:41:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1577554872.81.0.341402865021.issue11105@roundup.psfhosted.org>
In-reply-to
Content
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)
History
Date User Action Args
2019-12-28 17:41:12BTaskayasetrecipients: + BTaskaya, georg.brandl, gregory.p.smith, belopolsky, benjamin.peterson, meador.inge, eric.snow
2019-12-28 17:41:12BTaskayasetmessageid: <1577554872.81.0.341402865021.issue11105@roundup.psfhosted.org>
2019-12-28 17:41:12BTaskayalinkissue11105 messages
2019-12-28 17:41:12BTaskayacreate