From 2c24cdb4a34812c0835d2365b67cef6d5d67ebad Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sat, 26 Apr 2014 13:17:26 +0200 Subject: [PATCH] Comment out cast_object for IS_NULL --- Zend/zend_vm_def.h | 5 +++++ Zend/zend_vm_execute.h | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 6d3c7719e3..2538e86cd8 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -3795,6 +3795,10 @@ ZEND_VM_HANDLER(21, ZEND_CAST, CONST|TMP|VAR|CV, ANY) switch (opline->extended_value) { case IS_NULL: + /* This code is taken from convert_to_null. However, it does not seems very useful, + * because a conversion to null always results in the same value. This could only + * be relevant if a cast_object handler for IS_NULL has some kind of side-effect. */ +#if 0 if (OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) { ZVAL_DEREF(expr); } @@ -3803,6 +3807,7 @@ ZEND_VM_HANDLER(21, ZEND_CAST, CONST|TMP|VAR|CV, ANY) break; } } +#endif ZVAL_NULL(result); break; diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 7241cf49c7..6abc07d4e5 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -2791,6 +2791,10 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) switch (opline->extended_value) { case IS_NULL: + /* This code is taken from convert_to_null. However, it does not seems very useful, + * because a conversion to null always results in the same value. This could only + * be relevant if a cast_object handler for IS_NULL has some kind of side-effect. */ +#if 0 if (IS_CONST == IS_VAR || IS_CONST == IS_CV) { ZVAL_DEREF(expr); } @@ -2799,6 +2803,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) break; } } +#endif ZVAL_NULL(result); break; @@ -7901,6 +7906,10 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) switch (opline->extended_value) { case IS_NULL: + /* This code is taken from convert_to_null. However, it does not seems very useful, + * because a conversion to null always results in the same value. This could only + * be relevant if a cast_object handler for IS_NULL has some kind of side-effect. */ +#if 0 if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) { ZVAL_DEREF(expr); } @@ -7909,6 +7918,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) break; } } +#endif ZVAL_NULL(result); break; @@ -13081,6 +13091,10 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) switch (opline->extended_value) { case IS_NULL: + /* This code is taken from convert_to_null. However, it does not seems very useful, + * because a conversion to null always results in the same value. This could only + * be relevant if a cast_object handler for IS_NULL has some kind of side-effect. */ +#if 0 if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { ZVAL_DEREF(expr); } @@ -13089,6 +13103,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) break; } } +#endif ZVAL_NULL(result); break; @@ -30127,6 +30142,10 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) switch (opline->extended_value) { case IS_NULL: + /* This code is taken from convert_to_null. However, it does not seems very useful, + * because a conversion to null always results in the same value. This could only + * be relevant if a cast_object handler for IS_NULL has some kind of side-effect. */ +#if 0 if (IS_CV == IS_VAR || IS_CV == IS_CV) { ZVAL_DEREF(expr); } @@ -30135,6 +30154,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) break; } } +#endif ZVAL_NULL(result); break; -- 2.40.0