summaryrefslogtreecommitdiffstats
path: root/Parser/asdl_c.py
diff options
context:
space:
mode:
authorBrandt Bucher <brandtbucher@microsoft.com>2023-06-15 22:45:13 (GMT)
committerGitHub <noreply@github.com>2023-06-15 22:45:13 (GMT)
commita4056c8f9c2d9970d39e3cb6bffb255cd4b8a42c (patch)
treeefd886491257b999b29b0057e7153640b9d59aac /Parser/asdl_c.py
parent3af2dc7588614c65e9d1178ad9b4a11a19c14dde (diff)
downloadcpython-a4056c8f9c2d9970d39e3cb6bffb255cd4b8a42c.zip
cpython-a4056c8f9c2d9970d39e3cb6bffb255cd4b8a42c.tar.gz
cpython-a4056c8f9c2d9970d39e3cb6bffb255cd4b8a42c.tar.bz2
GH-105588: Add missing error checks to some obj2ast_* converters (GH-105589)
Diffstat (limited to 'Parser/asdl_c.py')
-rwxr-xr-xParser/asdl_c.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index cb31279..d4763ea 100755
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -601,6 +601,7 @@ class Obj2ModVisitor(PickleVisitor):
args = [f.name for f in prod.fields]
args.extend([a.name for a in prod.attributes])
self.emit("*out = %s(%s);" % (ast_func_name(name), self.buildArgs(args)), 1)
+ self.emit("if (*out == NULL) goto failed;", 1)
self.emit("return 0;", 1)
self.emit("failed:", 0)
self.emit("Py_XDECREF(tmp);", 1)