Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40616 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68905 invoked from network); 23 Sep 2008 05:02:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Sep 2008 05:02:14 -0000 Authentication-Results: pb1.pair.com smtp.mail=ilia.cheishvili@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ilia.cheishvili@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.14 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: ilia.cheishvili@gmail.com X-Host-Fingerprint: 209.85.217.14 mail-gx0-f14.google.com Received: from [209.85.217.14] ([209.85.217.14:38133] helo=mail-gx0-f14.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D9/06-35835-55878D84 for ; Tue, 23 Sep 2008 01:02:13 -0400 Received: by gxk7 with SMTP id 7so3829957gxk.23 for ; Mon, 22 Sep 2008 22:02:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=MX5dROaNYYpCeS9ZdCf7QMDQRoym6OMQsaXXxd0/BdE=; b=LPXNrNOZjPBK4gRoqflUs621e1fMNz5FqFpkLw6YI6ZYSFpmprYgZsB/I6MVQgrfKP O9Ynljimjt3pirSZirS3GmdABNrQw1wRM0XBxU5A0bSwZzQEP12xAG2yErnwEGQiNdIT PKwepGrwXCgC5G5jqJNMDBVUk4CaqfldZCYcw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=QpvNABnbby7zKrz/K/VILGntA19jVx+DVjvSbkeshWlQuL3YeMVCWDnN97Ul9G9EoW scZUmOflMjZnPjPM1BCC4/WyGYbIqe+9EMP83vlPRQawY0zhkacVMCP/GkmzpX6bq66c z18NEeAlvSTdWkHo6LIpJlw2Z8aE2XrPkqev4= Received: by 10.151.109.11 with SMTP id l11mr5576175ybm.206.1222146131058; Mon, 22 Sep 2008 22:02:11 -0700 (PDT) Received: by 10.151.144.11 with HTTP; Mon, 22 Sep 2008 22:02:11 -0700 (PDT) Message-ID: Date: Mon, 22 Sep 2008 23:02:11 -0600 To: internals@lists.php.net MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_86842_28128507.1222146131043" Subject: Proposed Patch: Fix compiler warning in Zend/zend_execute.c From: ilia.cheishvili@gmail.com ("Ilia Cheishvili") ------=_Part_86842_28128507.1222146131043 Content-Type: multipart/alternative; boundary="----=_Part_86843_15501375.1222146131043" ------=_Part_86843_15501375.1222146131043 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi all, My name is Ilia--I figured that since this is my first patch to the PHP core, I should refrain from submitting a massive patch and keep it simple. The patch that I have attached fixes a simple compiler warning within Zend/zend_execute.c. The compiler was complaining about comparing signed and unsigned integers. What I did was wrap the whole block in an if statement that first ensures that the signed integer in the comparison is greater than or equal to 0 and then casts it to unsigned and actually does the comparison. Since the actual comparison logic is checking to see that an unsigned integer is larger than the one I am casting, this is all safe. Also, the entire test suite runs fine and the output is unchanged. All in all, I am confident with it. After having used PHP for so many years, I'm really excited about finally having found the time to apply my C knowledge and actually start contributing back to the project :) Thanks! Ilia ------=_Part_86843_15501375.1222146131043 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
Hi all,

My name is Ilia--I figured that since this is my first patch to the PHP core, I should refrain from submitting a massive patch and keep it simple.  The patch that I have attached fixes a simple compiler warning within Zend/zend_execute.c.

The compiler was complaining about comparing signed and unsigned integers.  What I did was wrap the whole block in an if statement that first ensures that the signed integer in the comparison is greater than or equal to 0 and then casts it to unsigned and actually does the comparison.  Since the actual comparison logic is checking to see that an unsigned integer is larger than the one I am casting, this is all safe.

Also, the entire test suite runs fine and the output is unchanged.  All in all, I am confident with it.

After having used PHP for so many years, I'm really excited about finally having found the time to apply my C knowledge and actually start contributing back to the project :)

Thanks!

Ilia
------=_Part_86843_15501375.1222146131043-- ------=_Part_86842_28128507.1222146131043 Content-Type: text/plain; name=zend_execute.c.diff.txt Content-Transfer-Encoding: base64 X-Attachment-Id: f_flg1vw4l0 Content-Disposition: attachment; filename=zend_execute.c.diff.txt SW5kZXg6IHplbmRfZXhlY3V0ZS5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KUkNTIGZpbGU6IC9yZXBvc2l0b3J5L1pl bmRFbmdpbmUyL3plbmRfZXhlY3V0ZS5jLHYKcmV0cmlldmluZyByZXZpc2lvbiAxLjcxNi4yLjEy LjIuMjQuMi4zNgpkaWZmIC11IC1iIC1yMS43MTYuMi4xMi4yLjI0LjIuMzYgemVuZF9leGVjdXRl LmMKLS0tIHplbmRfZXhlY3V0ZS5jCTE1IEF1ZyAyMDA4IDE5OjQ3OjIzIC0wMDAwCTEuNzE2LjIu MTIuMi4yNC4yLjM2CisrKyB6ZW5kX2V4ZWN1dGUuYwkyMyBTZXAgMjAwOCAwNDoyMzoyNCAtMDAw MApAQCAtNjI2LDcgKzYyNiw5IEBACiAJCQlyZXR1cm4gMDsKIAkJfQogCi0JCWlmIChULT5zdHJf b2Zmc2V0Lm9mZnNldCA+PSBaX1NUUkxFTl9QKFQtPnN0cl9vZmZzZXQuc3RyKSkgeworCQlpZiAo Wl9TVFJMRU5fUChULT5zdHJfb2Zmc2V0LnN0cikgPj0gMCkKKwkJeworCQkJaWYgKFQtPnN0cl9v ZmZzZXQub2Zmc2V0ID49ICh1bnNpZ25lZCBpbnQpIFpfU1RSTEVOX1AoVC0+c3RyX29mZnNldC5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