]> granicus.if.org Git - php/commitdiff
Remove CV limitation when determining value from type in SCCP
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 5 Dec 2019 14:01:51 +0000 (15:01 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 5 Dec 2019 14:26:16 +0000 (15:26 +0100)
As far as I can determine, this is no longer a problem: We will
not try to remove the defining instructions (this is only done if
the value is known by SCCP itself) and we also only determine
non-refcounted values in this way, so it is not a problem if the
FREE is omitted.

ext/opcache/Optimizer/sccp.c

index 9c21f35d70ec937465dfb939bee0f39fe358e49a..0c62e1bd0d57001f116424e489d1a3bb5909b745 100644 (file)
@@ -2164,11 +2164,6 @@ static zval *value_from_type_and_range(sccp_ctx *ctx, int var_num, zval *tmp) {
        zend_ssa *ssa = ctx->scdf.ssa;
        zend_ssa_var_info *info = &ssa->var_info[var_num];
 
-       if (ssa->vars[var_num].var >= ctx->scdf.op_array->last_var) {
-               // TODO Non-CVs may cause issues with FREEs
-               return NULL;
-       }
-
        if (info->type & MAY_BE_UNDEF) {
                return NULL;
        }