D5235: revlog: replace PyInt_AS_LONG with a more portable helper function

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Thu Nov 8 06:27:29 EST 2018


yuja added a comment.


  > @@ -464,7 +470,9 @@
  > 
  >   		if (iter == NULL)
  >   			return -2;
  >   		while ((iter_item = PyIter_Next(iter))) {
  > 
  > - iter_item_long = PyInt_AS_LONG(iter_item); +			if (!pylong_to_long(iter_item, &iter_item_long)) { +				return -1;
  
  `Py_DECREF(iter_item)` and `return -2`.
  
  I didn't notice it last time, sorry.
  
  > +			}
  > 
  >   			Py_DECREF(iter_item);
  >   			if (iter_item_long < min_idx)
  >   				min_idx = iter_item_long;

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D5235

To: durin42, #hg-reviewers
Cc: yuja, mercurial-devel


More information about the Mercurial-devel mailing list