diff options
author | Brandt Bucher <brandtbucher@microsoft.com> | 2023-06-15 22:45:13 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-15 22:45:13 (GMT) |
commit | a4056c8f9c2d9970d39e3cb6bffb255cd4b8a42c (patch) | |
tree | efd886491257b999b29b0057e7153640b9d59aac /Parser/asdl_c.py | |
parent | 3af2dc7588614c65e9d1178ad9b4a11a19c14dde (diff) | |
download | cpython-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-x | Parser/asdl_c.py | 1 |
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) |