changeset 45177:03332e5f67e9

phases: make sure an exception should be set on error return This should never happen, but the code looks wrong without PyErr_Set*() call.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 18 Jul 2020 18:21:26 +0900
parents 3264d58e8b06
children b00fa1782efe
files mercurial/cext/revlog.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cext/revlog.c	Sat Jul 18 18:19:14 2020 +0900
+++ b/mercurial/cext/revlog.c	Sat Jul 18 18:21:26 2020 +0900
@@ -867,6 +867,10 @@
 			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);