]> granicus.if.org Git - php/commitdiff
Clean up a few more places
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 17 Mar 2020 14:23:52 +0000 (15:23 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 17 Mar 2020 14:23:52 +0000 (15:23 +0100)
ext/opcache/Optimizer/escape_analysis.c
ext/opcache/Optimizer/sccp.c
ext/opcache/Optimizer/zend_inference.c

index b27e12ec4d4482ae40c7d9f6d8996ae5a07d374b..a5577d59952a76e628984ef4c667395d604ddaf9 100644 (file)
@@ -216,8 +216,6 @@ static int is_allocation_def(zend_op_array *op_array, zend_ssa *ssa, int def, in
                                }
                                break;
                        case ZEND_ASSIGN_DIM:
-                       case ZEND_ASSIGN_OBJ:
-                       case ZEND_ASSIGN_OBJ_REF:
                                if (OP1_INFO() & (MAY_BE_UNDEF | MAY_BE_NULL | MAY_BE_FALSE)) {
                                        /* implicit object/array allocation */
                                        return 1;
index e72a38f43fc6b9f4696cb7b2c54e837a459cb9ab..fd83424f095baeb1e6615394a3bac97febe1371b 100644 (file)
@@ -1201,11 +1201,6 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
                                        return;
                                }
 
-                               /* If $a in $a->foo=$c is UNDEF, treat it like NULL. There is no warning. */
-                               if ((var_info->type & MAY_BE_ANY) == 0) {
-                                       op1 = &EG(uninitialized_zval);
-                               }
-
                                if (IS_BOT(op1)) {
                                        SET_RESULT_BOT(result);
                                        SET_RESULT_BOT(op1);
index 8c80c29e25c17d1179b64e4fdfaa2937b212abeb..fda79894249110d849d75a80ed37d089880a91cf 100644 (file)
@@ -2554,12 +2554,6 @@ static zend_always_inline int _zend_update_type_info(
                                                tmp |= MAY_BE_NULL;
                                        }
                                } else if (opline->opcode == ZEND_ASSIGN_OBJ_OP) {
-                                       if (orig & (MAY_BE_ANY - (MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT))) {
-                                               /* null and false (and empty string) are implicitly converted to object,
-                                                * anything else results in a null return value. */
-                                               tmp |= MAY_BE_NULL;
-                                       }
-
                                        /* The return value must also satisfy the property type */
                                        if (prop_info) {
                                                tmp &= zend_fetch_prop_type(script, prop_info, NULL);