This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients doerwalter, lemburg, loewis, pitrou, vstinner
Date 2010-04-20.21:09:53
SpamBayes Score 0.037375487
Marked as misclassified No
Message-id <1271797794.58.0.927187826817.issue8092@psf.upfronthosting.co.za>
In-reply-to
Content
> I don't know if "nallocated += repsize - 4;" can overflow or not.
> If yes, how can I detect the overflow?

Sure, if they are both Py_ssize_t, just use:

if (nallocated > PY_SSIZE_T_MAX - repsize + 4) {
  /* handle overflow ... */
}
History
Date User Action Args
2010-04-20 21:09:54pitrousetrecipients: + pitrou, lemburg, loewis, doerwalter, vstinner
2010-04-20 21:09:54pitrousetmessageid: <1271797794.58.0.927187826817.issue8092@psf.upfronthosting.co.za>
2010-04-20 21:09:53pitroulinkissue8092 messages
2010-04-20 21:09:53pitroucreate