# HG changeset patch # User Yuya Nishihara # Date 2020-07-18 09:21:26 # Node ID 03332e5f67e98ce6a232912ca3fcd0f34003fcf2 # Parent 3264d58e8b0617296e9d6f13504515fc95e30ebf phases: make sure an exception should be set on error return This should never happen, but the code looks wrong without PyErr_Set*() call. diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c --- a/mercurial/cext/revlog.c +++ b/mercurial/cext/revlog.c @@ -867,6 +867,10 @@ static PyObject *compute_phases_map_sets pyphase = phasesets[3]; break; default: + /* this should never happen since the phase number is + * specified by this function. */ + PyErr_SetString(PyExc_SystemError, + "bad phase number in internal list"); goto release; } pyrev = PyInt_FromLong(rev);