Grokbase Groups PHP php-cvs May 2016
FAQ
Commit: 27f40676e6f506f353ad8d679dd9b21aa87b828e
Author: Xinchen Hui <laruence@gmail.com> Fri, 27 May 2016 10:48:36 -0700
Parents: da511f255ac8e86284bdff6d7bc78d0b5c9b001f
Branches: master

Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=27f40676e6f506f353ad8d679dd9b21aa87b828e

Log:
assert won't cause indrect var access if it's disabled

Changed paths:
   M ext/opcache/Optimizer/zend_cfg.c


Diff:
diff --git a/ext/opcache/Optimizer/zend_cfg.c b/ext/opcache/Optimizer/zend_cfg.c
index 9701f58..a4403a0 100644
--- a/ext/opcache/Optimizer/zend_cfg.c
+++ b/ext/opcache/Optimizer/zend_cfg.c
@@ -331,7 +331,7 @@ int zend_build_cfg(zend_arena **arena, const zend_op_array *op_array, uint32_t b
         flags |= ZEND_FUNC_INDIRECT_VAR_ACCESS;
        } else if (zend_string_equals_literal(Z_STR_P(zv), "get_defined_vars")) {
         flags |= ZEND_FUNC_INDIRECT_VAR_ACCESS;
- } else if (zend_string_equals_literal(Z_STR_P(zv), "assert")) {
+ } else if (EG(assertions) >= 0 && zend_string_equals_literal(Z_STR_P(zv), "assert")) {
         flags |= ZEND_FUNC_INDIRECT_VAR_ACCESS;
        } else if (zend_string_equals_literal(Z_STR_P(zv), "func_num_args")) {
         flags |= ZEND_FUNC_VARARG;

Search Discussions

  • Nikita Popov at May 27, 2016 at 5:51 pm

    On Fri, May 27, 2016 at 7:48 PM, Xinchen Hui wrote:

    Commit: 27f40676e6f506f353ad8d679dd9b21aa87b828e
    Author: Xinchen Hui <laruence@gmail.com> Fri, 27 May 2016
    10:48:36 -0700
    Parents: da511f255ac8e86284bdff6d7bc78d0b5c9b001f
    Branches: master

    Link:
    http://git.php.net/?p=php-src.git;a=commitdiff;h=27f40676e6f506f353ad8d679dd9b21aa87b828e

    Log:
    assert won't cause indrect var access if it's disabled

    Changed paths:
    M ext/opcache/Optimizer/zend_cfg.c


    Diff:
    diff --git a/ext/opcache/Optimizer/zend_cfg.c
    b/ext/opcache/Optimizer/zend_cfg.c
    index 9701f58..a4403a0 100644
    --- a/ext/opcache/Optimizer/zend_cfg.c
    +++ b/ext/opcache/Optimizer/zend_cfg.c
    @@ -331,7 +331,7 @@ int zend_build_cfg(zend_arena **arena, const
    zend_op_array *op_array, uint32_t b
    flags |=
    ZEND_FUNC_INDIRECT_VAR_ACCESS;
    } else if
    (zend_string_equals_literal(Z_STR_P(zv), "get_defined_vars")) {
    flags |=
    ZEND_FUNC_INDIRECT_VAR_ACCESS;
    - } else if
    (zend_string_equals_literal(Z_STR_P(zv), "assert")) {
    + } else if (EG(assertions)
    = 0 && zend_string_equals_literal(Z_STR_P(zv), "assert")) {
    flags |=
    ZEND_FUNC_INDIRECT_VAR_ACCESS;
    } else if
    (zend_string_equals_literal(Z_STR_P(zv), "func_num_args")) {
    flags |=
    ZEND_FUNC_VARARG;


    --
    PHP CVS Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php
    If it's disabled as assertions=-1, it shouldn't generate any assert() call
    in the first place, right?

    Nikita
  • Xinchen Hui at May 28, 2016 at 7:11 am
    Hey:
    On Sat, May 28, 2016 at 1:51 AM, Nikita Popov wrote:
    On Fri, May 27, 2016 at 7:48 PM, Xinchen Hui wrote:

    Commit: 27f40676e6f506f353ad8d679dd9b21aa87b828e
    Author: Xinchen Hui <laruence@gmail.com> Fri, 27 May 2016
    10:48:36 -0700
    Parents: da511f255ac8e86284bdff6d7bc78d0b5c9b001f
    Branches: master

    Link:
    http://git.php.net/?p=php-src.git;a=commitdiff;h=27f40676e6f506f353ad8d679dd9b21aa87b828e

    Log:
    assert won't cause indrect var access if it's disabled

    Changed paths:
    M ext/opcache/Optimizer/zend_cfg.c


    Diff:
    diff --git a/ext/opcache/Optimizer/zend_cfg.c
    b/ext/opcache/Optimizer/zend_cfg.c
    index 9701f58..a4403a0 100644
    --- a/ext/opcache/Optimizer/zend_cfg.c
    +++ b/ext/opcache/Optimizer/zend_cfg.c
    @@ -331,7 +331,7 @@ int zend_build_cfg(zend_arena **arena, const
    zend_op_array *op_array, uint32_t b
    flags |=
    ZEND_FUNC_INDIRECT_VAR_ACCESS;
    } else if
    (zend_string_equals_literal(Z_STR_P(zv), "get_defined_vars")) {
    flags |=
    ZEND_FUNC_INDIRECT_VAR_ACCESS;
    - } else if
    (zend_string_equals_literal(Z_STR_P(zv), "assert")) {
    + } else if (EG(assertions)
    = 0 && zend_string_equals_literal(Z_STR_P(zv), "assert")) {
    flags |=
    ZEND_FUNC_INDIRECT_VAR_ACCESS;
    } else if
    (zend_string_equals_literal(Z_STR_P(zv), "func_num_args")) {
    flags |=
    ZEND_FUNC_VARARG;


    --
    PHP CVS Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php
    If it's disabled as assertions=-1, it shouldn't generate any assert() call
    in the first place, right?
    yes, this had been reverted soon after this commit.
    https://github.com/php/php-src/commit/4935c032762c376c19308b7cdf1b77780f1b073a

    anway, EG(assertion) can be toggled between 0, and 1 in run-time by
    ini_set, so in theory, if it's 0, it should not cause
    INDIRECT_VAR_ACCESS.

    but we can not be aware of ini_set aginst it.

    thanks

    Nikita

    --
    Xinchen Hui
    @Laruence
    http://www.laruence.com/

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-cvs @
categoriesphp
postedMay 27, '16 at 5:49p
activeMay 28, '16 at 7:11a
posts3
users2
websitephp.net

2 users in discussion

Xinchen Hui: 2 posts Nikita Popov: 1 post

People

Translate

site design / logo © 2019 Grokbase