[3.12] GH-105588: Add missing error checks to some obj2ast_* converters (GH-105838)

GH-105588: Add missing error checks to some obj2ast_* converters (GH-105589)
(cherry picked from commit a4056c8f9c)

Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
This commit is contained in:
Miss Islington (bot) 2023-06-15 16:12:01 -07:00 committed by GitHub
parent e9cf5a324e
commit 0add51672d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 0 deletions

View file

@ -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)