mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
[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:
parent
e9cf5a324e
commit
0add51672d
4 changed files with 37 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue