diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-10-10 08:00:19 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-10 08:00:19 (GMT) |
commit | 6b6935e563562c427d5bb1b2864d6a2fed0e74fa (patch) | |
tree | c1403c0477925c2d90bfa2e2a5fd373fb82becfb /Parser | |
parent | 0baa6b3c7d9ef1d96f10939c40f8ff95aba9155b (diff) | |
download | cpython-6b6935e563562c427d5bb1b2864d6a2fed0e74fa.zip cpython-6b6935e563562c427d5bb1b2864d6a2fed0e74fa.tar.gz cpython-6b6935e563562c427d5bb1b2864d6a2fed0e74fa.tar.bz2 |
bpo-38425: Fix ‘res’ may be used uninitialized warning (GH-16688)
(cherry picked from commit a05fcd3c7adf6e3a0944da8cf80a3346882e9b3b)
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
Diffstat (limited to 'Parser')
-rw-r--r-- | Parser/asdl_c.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index f4fa271..574fcb0 100644 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -1191,7 +1191,6 @@ PyObject* PyAST_mod2obj(mod_ty t) /* mode is 0 for "exec", 1 for "eval" and 2 for "single" input */ mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode) { - mod_ty res; PyObject *req_type[3]; char *req_name[] = {"Module", "Expression", "Interactive"}; int isinstance; @@ -1217,6 +1216,8 @@ mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode) req_name[mode], Py_TYPE(ast)->tp_name); return NULL; } + + mod_ty res = NULL; if (obj2ast_mod(ast, &res, arena) != 0) return NULL; else |