Skip to content

Commit

Permalink
bpo-38425: Fix ‘res’ may be used uninitialized warning (pythonGH-16688)
Browse files Browse the repository at this point in the history
  • Loading branch information
corona10 authored and vstinner committed Oct 10, 2019
1 parent 7bb1431 commit a05fcd3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Parser/asdl_c.py
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,6 @@ class PartingShots(StaticVisitor):
/* 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];
const char * const req_name[] = {"Module", "Expression", "Interactive"};
int isinstance;
Expand All @@ -1223,6 +1222,8 @@ class PartingShots(StaticVisitor):
req_name[mode], _PyType_Name(Py_TYPE(ast)));
return NULL;
}
mod_ty res = NULL;
if (obj2ast_mod(ast, &res, arena) != 0)
return NULL;
else
Expand Down
3 changes: 2 additions & 1 deletion Python/Python-ast.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a05fcd3

Please sign in to comment.