Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77601 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8568 invoked from network); 25 Sep 2014 01:17:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Sep 2014 01:17:14 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 108.166.43.91 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.91 smtp91.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.91] ([108.166.43.91:42294] helo=smtp91.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 11/20-06184-91D63245 for ; Wed, 24 Sep 2014 21:17:14 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp20.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id 34DE8801C4; Wed, 24 Sep 2014 21:17:11 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp20.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id E3325801C7; Wed, 24 Sep 2014 21:17:10 -0400 (EDT) X-Sender-Id: smalyshev@sugarcrm.com Received: from Stass-MacBook-Pro.local ([UNAVAILABLE]. [74.85.23.222]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA) by 0.0.0.0:465 (trex/5.2.13); Thu, 25 Sep 2014 01:17:11 GMT Message-ID: <54236D16.3070401@sugarcrm.com> Date: Wed, 24 Sep 2014 18:17:10 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Rowan Collins , "internals@lists.php.net" References: <07153B91-E12F-4B16-ADD7-86CFC75C4642@ajf.me> <54220EB4.60001@sugarcrm.com> <6A21F4EF-476E-476C-A64B-246B8929172B@ajf.me> <5422DD87.80109@gmail.com> <568C0F03-B23B-43FC-963D-6D0D23405E9D@ajf.me> <54230209.2050406@sugarcrm.com> <54233C70.3060604@gmail.com> In-Reply-To: <54233C70.3060604@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] ZPP Failure On Overflow From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > So, the problem comes with built-in functions, which have some side > effect, which can be usefully run with a bogus value for an integer > argument. In contrast, any function which has some side effect which is > actively harmful given a bogus value would be a beneficiary of the change. No bogus value ever gets to a function - it always gets INT_MAX on overflow. If INT_MAX is harmful for this function, this change does not help as you could still pass INT_MAX and this change would not do anything. The thing is relying on this would not really improve your code - it is very rare that INT_MAX+1 is harmful for your function but INT_MAX-1 is not. But it may be useful to know that you can pass any value and it will be capped at INT_MAX. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/