parsers: fix istat macro to work with single line if statement
authorMatt Fowles <matt.fowles@gmail.com>
Tue, 05 Apr 2016 10:43:43 -0400
changeset 28792 507136150d2b
parent 28791 277b4e6938fa
child 28793 d30fdd6d1bf7
parsers: fix istat macro to work with single line if statement
mercurial/parsers.c
--- a/mercurial/parsers.c	Tue Apr 05 14:44:18 2016 +0300
+++ b/mercurial/parsers.c	Tue Apr 05 10:43:43 2016 -0400
@@ -1029,12 +1029,14 @@
 		return NULL;
 
 #define istat(__n, __d) \
-	t = PyInt_FromSsize_t(self->__n); \
-	if (!t) \
-		goto bail; \
-	if (PyDict_SetItemString(obj, __d, t) == -1) \
-		goto bail; \
-	Py_DECREF(t);
+	do { \
+		t = PyInt_FromSsize_t(self->__n); \
+		if (!t) \
+			goto bail; \
+		if (PyDict_SetItemString(obj, __d, t) == -1) \
+			goto bail; \
+		Py_DECREF(t); \
+	} while (0)
 
 	if (self->added) {
 		Py_ssize_t len = PyList_GET_SIZE(self->added);