summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSVN Migration <svn@php.net>2006-08-11 03:02:57 +0000
committerSVN Migration <svn@php.net>2006-08-11 03:02:57 +0000
commitefa64999fa3b0ba45dd7655b92949f0591094e7e (patch)
tree086a201e82f6b9c193c6f65331563f2d9a212595
parent91b6eb5f5cde8166da47ce5d83c8071d80eea393 (diff)
downloadphp-git-php-5.1.5RC1.tar.gz
This commit was manufactured by cvs2svn to create tag 'php_5_1_5RC1'.php-5.1.5RC1
-rw-r--r--Zend/acinclude.m42
-rw-r--r--Zend/tests/abstract-static.phpt24
-rw-r--r--Zend/tests/bug34873.phpt2
-rwxr-xr-xZend/tests/bug36513.phpt22
-rwxr-xr-xZend/tests/bug37046.phpt23
-rwxr-xr-xZend/tests/bug37138.phpt21
-rw-r--r--Zend/tests/object-null.phpt21
-rw-r--r--Zend/zend_API.c34
-rw-r--r--Zend/zend_alloc.c28
-rw-r--r--Zend/zend_compile.c1
-rw-r--r--Zend/zend_execute_API.c2
-rw-r--r--Zend/zend_ini_parser.y13
-rwxr-xr-xZend/zend_interfaces.c2
-rw-r--r--Zend/zend_language_scanner.l4
-rw-r--r--Zend/zend_opcode.c6
-rw-r--r--Zend/zend_strtod.c1
-rw-r--r--Zend/zend_vm_def.h23
-rw-r--r--Zend/zend_vm_execute.h116
18 files changed, 58 insertions, 287 deletions
diff --git a/Zend/acinclude.m4 b/Zend/acinclude.m4
index 77b9bbdeb4..4264526775 100644
--- a/Zend/acinclude.m4
+++ b/Zend/acinclude.m4
@@ -4,7 +4,7 @@ dnl This file contains local autoconf functions.
AC_DEFUN([LIBZEND_BISON_CHECK],[
# we only support certain bison versions
- bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3"
+ bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1"
# for standalone build of Zend Engine
test -z "$SED" && SED=sed
diff --git a/Zend/tests/abstract-static.phpt b/Zend/tests/abstract-static.phpt
deleted file mode 100644
index 9db88fc4c8..0000000000
--- a/Zend/tests/abstract-static.phpt
+++ /dev/null
@@ -1,24 +0,0 @@
---TEST--
-Test for abstract static classes
---FILE--
-<?php
-abstract class ezcDbHandler extends PDO
-{
- public function __construct( $dbParams, $dsn )
- {
- $user = null;
- $pass = null;
- $driverOptions = null;
- }
-
- abstract static public function getName();
-
- static public function hasFeature( $feature )
- {
- return false;
- }
-}
-?>
-DONE
---EXPECT--
-DONE
diff --git a/Zend/tests/bug34873.phpt b/Zend/tests/bug34873.phpt
index 7d9eb78ab7..d8683c991f 100644
--- a/Zend/tests/bug34873.phpt
+++ b/Zend/tests/bug34873.phpt
@@ -1,5 +1,5 @@
--TEST--
-Bug #34873 (Segmentation Fault on foreach in object)
+bug #34873 (Segmentation Fault on foreach in object)
--FILE--
<?php
class pwa {
diff --git a/Zend/tests/bug36513.phpt b/Zend/tests/bug36513.phpt
deleted file mode 100755
index f46da4efc5..0000000000
--- a/Zend/tests/bug36513.phpt
+++ /dev/null
@@ -1,22 +0,0 @@
---TEST--
-Bug #36513 (comment will be outputed in last line)
---FILE--
-<?php
-function test($s) {
- echo "'".trim(str_replace("&nbsp;", " ", htmlspecialchars_decode(strip_tags(highlight_string($s,1)))))."'\n";
-}
-
-eval('echo "1";//2');
-eval('echo 3; //{ 4?>5');
-echo "\n";
-
-//test('<?php echo "1";//');
-test('<?php echo "1";//2');
-test('<?php echo "1";//22');
-test('<?php echo 3; // 4 ?>5');
-?>
---EXPECT--
-135
-'<?php echo "1";//2'
-'<?php echo "1";//22'
-'<?php echo 3; // 4 ?>5'
diff --git a/Zend/tests/bug37046.phpt b/Zend/tests/bug37046.phpt
deleted file mode 100755
index 09b8f0cb5d..0000000000
--- a/Zend/tests/bug37046.phpt
+++ /dev/null
@@ -1,23 +0,0 @@
---TEST--
-Bug #37046 (foreach breaks static scope)
---FILE--
-<?php
-function s() {
- static $storage = array(array('x', 'y'));
- return $storage[0];
-}
-
-foreach (s() as $k => $function) {
- echo "op1 $k\n";
- if ($k == 0) {
- foreach (s() as $k => $function) {
- echo "op2 $k\n";
- }
- }
-}
-?>
---EXPECT--
-op1 0
-op2 0
-op2 1
-op1 1
diff --git a/Zend/tests/bug37138.phpt b/Zend/tests/bug37138.phpt
deleted file mode 100755
index f8503f8da9..0000000000
--- a/Zend/tests/bug37138.phpt
+++ /dev/null
@@ -1,21 +0,0 @@
---TEST--
-Bug #37138 (__autoload tries to load callback'ed self and parent)
---FILE--
-<?php
-function __autoload ($CN) {var_dump ($CN);}
-class st {
- public static function e () {echo ("EHLO\n");}
- public static function e2 () {call_user_func (array ('self', 'e'));}
-}
-class stch extends st {
- public static function g () {call_user_func (array ('parent', 'e'));}
-}
-st::e ();
-st::e2 ();
-stch::g ();
-?>
---EXPECT--
-EHLO
-EHLO
-EHLO
-
diff --git a/Zend/tests/object-null.phpt b/Zend/tests/object-null.phpt
deleted file mode 100644
index 650178c341..0000000000
--- a/Zend/tests/object-null.phpt
+++ /dev/null
@@ -1,21 +0,0 @@
---TEST--
-Test whether an object is NULL or not.
---FILE--
-<?php
-
-class Bla
-{
-}
-
-$b = new Bla;
-
-var_dump($b != null);
-var_dump($b == null);
-var_dump($b !== null);
-var_dump($b === null);
-?>
---EXPECT--
-bool(true)
-bool(false)
-bool(true)
-bool(false)
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 0a9b8213a0..71f3a504ff 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -2039,16 +2039,18 @@ static int zend_is_callable_check_func(int check_flags, zval ***zobj_ptr_ptr, ze
if ((colon = strstr(Z_STRVAL_P(callable), "::")) != NULL) {
clen = colon - Z_STRVAL_P(callable);
mlen = Z_STRLEN_P(callable) - clen - 2;
- lcname = zend_str_tolower_dup(Z_STRVAL_P(callable), clen);
- /* caution: lcname is not '\0' terminated */
- if (clen == sizeof("self") - 1 && memcmp(lcname, "self", sizeof("self") - 1) == 0) {
- *ce_ptr = EG(scope);
- } else if (clen == sizeof("parent") - 1 && memcmp(lcname, "parent", sizeof("parent") - 1) == 0 && EG(active_op_array)->scope) {
- *ce_ptr = EG(scope) ? EG(scope)->parent : NULL;
- } else if (zend_lookup_class(Z_STRVAL_P(callable), clen, &pce TSRMLS_CC) == SUCCESS) {
+ if (zend_lookup_class(Z_STRVAL_P(callable), clen, &pce TSRMLS_CC) == SUCCESS) {
*ce_ptr = *pce;
+ } else {
+ lcname = zend_str_tolower_dup(Z_STRVAL_P(callable), clen);
+ /* caution: lcname is not '\0' terminated */
+ if (clen == sizeof("self") - 1 && memcmp(lcname, "self", sizeof("self") - 1) == 0) {
+ *ce_ptr = EG(scope);
+ } else if (clen == sizeof("parent") - 1 && memcmp(lcname, "parent", sizeof("parent") - 1) == 0 && EG(active_op_array)->scope) {
+ *ce_ptr = EG(scope) ? EG(scope)->parent : NULL;
+ }
+ efree(lcname);
}
- efree(lcname);
if (!*ce_ptr) {
return 0;
}
@@ -2177,15 +2179,17 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, uint check_flags, char **
return 1;
}
- lcname = zend_str_tolower_dup(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj));
- if (Z_STRLEN_PP(obj) == sizeof("self") - 1 && memcmp(lcname, "self", sizeof("self")) == 0) {
- ce = EG(active_op_array)->scope;
- } else if (Z_STRLEN_PP(obj) == sizeof("parent") - 1 && memcmp(lcname, "parent", sizeof("parent")) == 0 && EG(active_op_array)->scope) {
- ce = EG(active_op_array)->scope->parent;
- } else if (zend_lookup_class(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), &pce TSRMLS_CC) == SUCCESS) {
+ if (zend_lookup_class(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), &pce TSRMLS_CC) == SUCCESS) {
ce = *pce;
+ } else if (EG(active_op_array)) {
+ lcname = zend_str_tolower_dup(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj));
+ if (Z_STRLEN_PP(obj) == sizeof("self") - 1 && memcmp(lcname, "self", sizeof("self")) == 0) {
+ ce = EG(active_op_array)->scope;
+ } else if (Z_STRLEN_PP(obj) == sizeof("parent") - 1 && memcmp(lcname, "parent", sizeof("parent")) == 0 && EG(active_op_array)->scope) {
+ ce = EG(active_op_array)->scope->parent;
+ }
+ efree(lcname);
}
- efree(lcname);
} else {
ce = Z_OBJCE_PP(obj); /* TBFixed: what if it's overloaded? */
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c
index 3de98292f0..086a3785c8 100644
--- a/Zend/zend_alloc.c
+++ b/Zend/zend_alloc.c
@@ -72,15 +72,7 @@ static long mem_block_end_magic = MEM_BLOCK_END_MAGIC;
#define CHECK_MEMORY_LIMIT(s, rs) _CHECK_MEMORY_LIMIT(s, rs, NULL, 0)
# endif
-#define _CHECK_MEMORY_LIMIT(s, rs, file, lineno) { if ((ssize_t)(rs) > (ssize_t)(INT_MAX - AG(allocated_memory))) { \
- if (file) { \
- fprintf(stderr, "Integer overflow in memory_limit check detected at %s:%d\n", file, lineno); \
- } else { \
- fprintf(stderr, "Integer overflow in memory_limit check detected\n"); \
- } \
- exit(1); \
- } \
- AG(allocated_memory) += rs;\
+#define _CHECK_MEMORY_LIMIT(s, rs, file, lineno) { AG(allocated_memory) += rs;\
if (AG(memory_limit)<AG(allocated_memory)) {\
int php_mem_limit = AG(memory_limit); \
AG(allocated_memory) -= rs; \
@@ -135,7 +127,7 @@ static long mem_block_end_magic = MEM_BLOCK_END_MAGIC;
#endif
#define DECLARE_CACHE_VARS() \
- size_t real_size; \
+ unsigned int real_size; \
unsigned int cache_index
#define REAL_SIZE(size) ((size+7) & ~0x7)
@@ -150,16 +142,12 @@ static long mem_block_end_magic = MEM_BLOCK_END_MAGIC;
ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
- zend_mem_header *p = NULL;
+ zend_mem_header *p;
DECLARE_CACHE_VARS();
TSRMLS_FETCH();
CALCULATE_REAL_SIZE_AND_CACHE_INDEX(size);
- if (size > INT_MAX || SIZE < size) {
- goto emalloc_error;
- }
-
#if !ZEND_DISABLE_MEMORY_CACHE
if ((CACHE_INDEX < MAX_CACHED_MEMORY) && (AG(cache_count)[CACHE_INDEX] > 0)) {
p = AG(cache)[CACHE_INDEX][--AG(cache_count)[CACHE_INDEX]];
@@ -196,8 +184,6 @@ ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
}
#endif
-emalloc_error:
-
HANDLE_BLOCK_INTERRUPTIONS();
if (!p) {
@@ -371,13 +357,6 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LIN
CALCULATE_REAL_SIZE_AND_CACHE_INDEX(size);
HANDLE_BLOCK_INTERRUPTIONS();
-
- if (size > INT_MAX || SIZE < size) {
- REMOVE_POINTER_FROM_LIST(p);
- p = NULL;
- goto erealloc_error;
- }
-
#if MEMORY_LIMIT
CHECK_MEMORY_LIMIT(size - p->size, SIZE - REAL_SIZE(p->size));
if (AG(allocated_memory) > AG(allocated_memory_peak)) {
@@ -386,7 +365,6 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LIN
#endif
REMOVE_POINTER_FROM_LIST(p);
p = (zend_mem_header *) ZEND_DO_REALLOC(p, sizeof(zend_mem_header)+MEM_HEADER_PADDING+SIZE+END_MAGIC_SIZE);
-erealloc_error:
if (!p) {
if (!allow_failure) {
fprintf(stderr,"FATAL: erealloc(): Unable to allocate %ld bytes\n", (long) size);
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 096af0c2ff..6b9b4cdb3f 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -154,7 +154,6 @@ void zend_init_compiler_data_structures(TSRMLS_D)
void init_compiler(TSRMLS_D)
{
- CG(active_op_array) = NULL;
zend_init_compiler_data_structures(TSRMLS_C);
zend_init_rsrc_list(TSRMLS_C);
zend_hash_init(&CG(filenames_table), 5, NULL, (dtor_func_t) free_estring, 0);
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 71fe9d807e..ffa6b05504 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -819,7 +819,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
if (EX(function_state).function->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) {
if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) {
- zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name);
+ zend_error_noreturn(E_ERROR, "Cannot call abstract method %v::%v()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name);
}
if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) {
zend_error(E_STRICT, "Function %s%s%s() is deprecated",
diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y
index 244673dba6..8c1976ac88 100644
--- a/Zend/zend_ini_parser.y
+++ b/Zend/zend_ini_parser.y
@@ -249,26 +249,25 @@ string_or_value:
expr { $$ = $1; }
| CFG_TRUE { $$ = $1; }
| CFG_FALSE { $$ = $1; }
+ | var_string_list { $$ = $1; }
| '\n' { zend_ini_init_string(&$$); }
| /* empty */ { zend_ini_init_string(&$$); }
;
var_string_list:
- cfg_var_ref { $$ = $1; }
- | TC_ENCAPSULATED_STRING { $$ = $1; }
- | constant_string { $$ = $1; }
- | var_string_list cfg_var_ref { zend_ini_add_string(&$$, &$1, &$2); free($2.value.str.val); }
+ var_string_list cfg_var_ref { zend_ini_add_string(&$$, &$1, &$2); free($2.value.str.val); }
| var_string_list TC_ENCAPSULATED_STRING { zend_ini_add_string(&$$, &$1, &$2); free($2.value.str.val); }
- | var_string_list constant_string { zend_ini_add_string(&$$, &$1, &$2); free($2.value.str.val); }
+ | var_string_list constant_string { zend_ini_add_string(&$$, &$1, &$2); }
+ | /* empty */ { zend_ini_init_string(&$$); }
;
cfg_var_ref:
- TC_DOLLAR_CURLY TC_STRING '}' { zend_ini_get_var(&$$, &$2); free($2.value.str.val); }
+ TC_DOLLAR_CURLY TC_STRING '}' { zend_ini_get_var(&$$, &$2); }
;
expr:
- var_string_list { $$ = $1; }
+ constant_string { $$ = $1; }
| expr '|' expr { zend_ini_do_op('|', &$$, &$1, &$3); }
| expr '&' expr { zend_ini_do_op('&', &$$, &$1, &$3); }
| '~' expr { zend_ini_do_op('~', &$$, &$2, NULL); }
diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c
index cee89e11d7..2a93e77843 100755
--- a/Zend/zend_interfaces.c
+++ b/Zend/zend_interfaces.c
@@ -287,7 +287,7 @@ static zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *ce,
if (!ce || !ce_it || !ce_it->get_iterator || (ce_it->get_iterator == zend_user_it_get_new_iterator && iterator == object)) {
if (!EG(exception))
{
- zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Objects returned by %s::getIterator() must be traversable or implement interface Iterator", ce ? ce->name : Z_OBJCE_P(object)->name);
+ zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Objects returned by %s::getIterator() must be traversable or implement interface Iterator", ce->name);
}
if (iterator)
{
diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l
index 57581404f3..66e98988f7 100644
--- a/Zend/zend_language_scanner.l
+++ b/Zend/zend_language_scanner.l
@@ -1461,7 +1461,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
yymore();
}
-<ST_ONE_LINE_COMMENT>[^\n\r?%>]*{ANY_CHAR} {
+<ST_ONE_LINE_COMMENT>[^\n\r?%>]+{ANY_CHAR} {
switch (yytext[yyleng-1]) {
case '?': case '%': case '>':
yyless(yyleng-1);
@@ -1491,7 +1491,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
<ST_ONE_LINE_COMMENT>"?>"|"%>" {
if (CG(asp_tags) || yytext[yyleng-2] != '%') { /* asp comment? */
zendlval->value.str.val = yytext; /* no copying - intentional */
- zendlval->value.str.len = yyleng-2;
+ zendlval->value.str.len = yyleng;
zendlval->type = IS_STRING;
yyless(yyleng-2);
BEGIN(ST_IN_SCRIPTING);
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index 466dfbd2b5..9e68496939 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -367,10 +367,8 @@ int pass_two(zend_op_array *op_array TSRMLS_DC)
zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_handler, op_array TSRMLS_CC);
}
- if (!CG(interactive) && op_array->size != op_array->last) {
- op_array->opcodes = (zend_op *) erealloc(op_array->opcodes, sizeof(zend_op)*op_array->last);
- op_array->size = op_array->last;
- }
+ op_array->opcodes = (zend_op *) erealloc(op_array->opcodes, sizeof(zend_op)*op_array->last);
+ op_array->size = op_array->last;
opline = op_array->opcodes;
end = opline + op_array->last;
diff --git a/Zend/zend_strtod.c b/Zend/zend_strtod.c
index 3a469fd59c..3ad2c5f155 100644
--- a/Zend/zend_strtod.c
+++ b/Zend/zend_strtod.c
@@ -130,7 +130,6 @@ typedef unsigned long int uint32_t;
* but the word order is big endian.
*/
#define IEEE_BIG_ENDIAN
-#undef IEEE_LITTLE_ENDIAN
#endif
#ifdef __vax__
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index ed2e2f59a7..24d090ece7 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -1158,9 +1158,7 @@ ZEND_VM_HELPER_EX(zend_fetch_property_address_read_helper, VAR|UNUSED|CV, CONST|
if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
- if (type != BP_VAR_IS) {
- zend_error(E_NOTICE, "Trying to get property of non-object");
- }
+ zend_error(E_NOTICE, "Trying to get property of non-object");
*retval = EG(uninitialized_zval_ptr);
SELECTIVE_PZVAL_LOCK(*retval, &opline->result);
AI_USE_PTR(EX_T(opline->result.u.var).var);
@@ -3019,20 +3017,7 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
} else {
- if (OP1_TYPE == IS_VAR &&
- free_op1.var == NULL &&
- !array_ptr->is_ref &&
- array_ptr->refcount > 1) {
- /* non-separated return value from function */
- zval *tmp;
-
- ALLOC_ZVAL(tmp);
- INIT_PZVAL_COPY(tmp, array_ptr);
- zval_copy_ctor(tmp);
- array_ptr = tmp;
- } else {
- array_ptr->refcount++;
- }
+ array_ptr->refcount++;
}
}
@@ -3238,9 +3223,7 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
key->value.lval = int_key;
key->type = IS_LONG;
break;
- default:
- ZVAL_NULL(key);
- break;
+ EMPTY_SWITCH_DEFAULT_CASE()
}
}
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 2417f69a76..a9a3c5c2f7 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -2059,7 +2059,7 @@ static int ZEND_UNSET_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zend_free_op free_op1;
+
zval *array_ptr, **array_ptr_ptr;
HashTable *fe_ht;
zend_object_iterator *iter = NULL;
@@ -2100,20 +2100,7 @@ static int ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
} else {
- if (IS_CONST == IS_VAR &&
- free_op1.var == NULL &&
- !array_ptr->is_ref &&
- array_ptr->refcount > 1) {
- /* non-separated return value from function */
- zval *tmp;
-
- ALLOC_ZVAL(tmp);
- INIT_PZVAL_COPY(tmp, array_ptr);
- zval_copy_ctor(tmp);
- array_ptr = tmp;
- } else {
- array_ptr->refcount++;
- }
+ array_ptr->refcount++;
}
}
@@ -4531,20 +4518,7 @@ static int ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
} else {
- if (IS_TMP_VAR == IS_VAR &&
- free_op1.var == NULL &&
- !array_ptr->is_ref &&
- array_ptr->refcount > 1) {
- /* non-separated return value from function */
- zval *tmp;
-
- ALLOC_ZVAL(tmp);
- INIT_PZVAL_COPY(tmp, array_ptr);
- zval_copy_ctor(tmp);
- array_ptr = tmp;
- } else {
- array_ptr->refcount++;
- }
+ array_ptr->refcount++;
}
}
@@ -7544,20 +7518,7 @@ static int ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
} else {
- if (IS_VAR == IS_VAR &&
- free_op1.var == NULL &&
- !array_ptr->is_ref &&
- array_ptr->refcount > 1) {
- /* non-separated return value from function */
- zval *tmp;
-
- ALLOC_ZVAL(tmp);
- INIT_PZVAL_COPY(tmp, array_ptr);
- zval_copy_ctor(tmp);
- array_ptr = tmp;
- } else {
- array_ptr->refcount++;
- }
+ array_ptr->refcount++;
}
}
@@ -7763,9 +7724,7 @@ static int ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
key->value.lval = int_key;
key->type = IS_LONG;
break;
- default:
- ZVAL_NULL(key);
- break;
+ EMPTY_SWITCH_DEFAULT_CASE()
}
}
@@ -8674,9 +8633,7 @@ static int zend_fetch_property_address_read_helper_SPEC_VAR_CONST(int type, ZEND
if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
- if (type != BP_VAR_IS) {
- zend_error(E_NOTICE, "Trying to get property of non-object");
- }
+ zend_error(E_NOTICE, "Trying to get property of non-object");
*retval = EG(uninitialized_zval_ptr);
SELECTIVE_PZVAL_LOCK(*retval, &opline->result);
AI_USE_PTR(EX_T(opline->result.u.var).var);
@@ -10100,9 +10057,7 @@ static int zend_fetch_property_address_read_helper_SPEC_VAR_TMP(int type, ZEND_O
if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
- if (type != BP_VAR_IS) {
- zend_error(E_NOTICE, "Trying to get property of non-object");
- }
+ zend_error(E_NOTICE, "Trying to get property of non-object");
*retval = EG(uninitialized_zval_ptr);
SELECTIVE_PZVAL_LOCK(*retval, &opline->result);
AI_USE_PTR(EX_T(opline->result.u.var).var);
@@ -11529,9 +11484,7 @@ static int zend_fetch_property_address_read_helper_SPEC_VAR_VAR(int type, ZEND_O
if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
- if (type != BP_VAR_IS) {
- zend_error(E_NOTICE, "Trying to get property of non-object");
- }
+ zend_error(E_NOTICE, "Trying to get property of non-object");
*retval = EG(uninitialized_zval_ptr);
SELECTIVE_PZVAL_LOCK(*retval, &opline->result);
AI_USE_PTR(EX_T(opline->result.u.var).var);
@@ -13403,9 +13356,7 @@ static int zend_fetch_property_address_read_helper_SPEC_VAR_CV(int type, ZEND_OP
if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
- if (type != BP_VAR_IS) {
- zend_error(E_NOTICE, "Trying to get property of non-object");
- }
+ zend_error(E_NOTICE, "Trying to get property of non-object");
*retval = EG(uninitialized_zval_ptr);
SELECTIVE_PZVAL_LOCK(*retval, &opline->result);
AI_USE_PTR(EX_T(opline->result.u.var).var);
@@ -14600,9 +14551,7 @@ static int zend_fetch_property_address_read_helper_SPEC_UNUSED_CONST(int type, Z
if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
- if (type != BP_VAR_IS) {
- zend_error(E_NOTICE, "Trying to get property of non-object");
- }
+ zend_error(E_NOTICE, "Trying to get property of non-object");
*retval = EG(uninitialized_zval_ptr);
SELECTIVE_PZVAL_LOCK(*retval, &opline->result);
AI_USE_PTR(EX_T(opline->result.u.var).var);
@@ -15679,9 +15628,7 @@ static int zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP(int type, ZEN
if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
- if (type != BP_VAR_IS) {
- zend_error(E_NOTICE, "Trying to get property of non-object");
- }
+ zend_error(E_NOTICE, "Trying to get property of non-object");
*retval = EG(uninitialized_zval_ptr);
SELECTIVE_PZVAL_LOCK(*retval, &opline->result);
AI_USE_PTR(EX_T(opline->result.u.var).var);
@@ -16719,9 +16666,7 @@ static int zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR(int type, ZEN
if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
- if (type != BP_VAR_IS) {
- zend_error(E_NOTICE, "Trying to get property of non-object");
- }
+ zend_error(E_NOTICE, "Trying to get property of non-object");
*retval = EG(uninitialized_zval_ptr);
SELECTIVE_PZVAL_LOCK(*retval, &opline->result);
AI_USE_PTR(EX_T(opline->result.u.var).var);
@@ -18124,9 +18069,7 @@ static int zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(int type, ZEND
if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
- if (type != BP_VAR_IS) {
- zend_error(E_NOTICE, "Trying to get property of non-object");
- }
+ zend_error(E_NOTICE, "Trying to get property of non-object");
*retval = EG(uninitialized_zval_ptr);
SELECTIVE_PZVAL_LOCK(*retval, &opline->result);
AI_USE_PTR(EX_T(opline->result.u.var).var);
@@ -19631,7 +19574,7 @@ static int ZEND_UNSET_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zend_free_op free_op1;
+
zval *array_ptr, **array_ptr_ptr;
HashTable *fe_ht;
zend_object_iterator *iter = NULL;
@@ -19672,20 +19615,7 @@ static int ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
} else {
- if (IS_CV == IS_VAR &&
- free_op1.var == NULL &&
- !array_ptr->is_ref &&
- array_ptr->refcount > 1) {
- /* non-separated return value from function */
- zval *tmp;
-
- ALLOC_ZVAL(tmp);
- INIT_PZVAL_COPY(tmp, array_ptr);
- zval_copy_ctor(tmp);
- array_ptr = tmp;
- } else {
- array_ptr->refcount++;
- }
+ array_ptr->refcount++;
}
}
@@ -20660,9 +20590,7 @@ static int zend_fetch_property_address_read_helper_SPEC_CV_CONST(int type, ZEND_
if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
- if (type != BP_VAR_IS) {
- zend_error(E_NOTICE, "Trying to get property of non-object");
- }
+ zend_error(E_NOTICE, "Trying to get property of non-object");
*retval = EG(uninitialized_zval_ptr);
SELECTIVE_PZVAL_LOCK(*retval, &opline->result);
AI_USE_PTR(EX_T(opline->result.u.var).var);
@@ -22078,9 +22006,7 @@ static int zend_fetch_property_address_read_helper_SPEC_CV_TMP(int type, ZEND_OP
if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
- if (type != BP_VAR_IS) {
- zend_error(E_NOTICE, "Trying to get property of non-object");
- }
+ zend_error(E_NOTICE, "Trying to get property of non-object");
*retval = EG(uninitialized_zval_ptr);
SELECTIVE_PZVAL_LOCK(*retval, &opline->result);
AI_USE_PTR(EX_T(opline->result.u.var).var);
@@ -23499,9 +23425,7 @@ static int zend_fetch_property_address_read_helper_SPEC_CV_VAR(int type, ZEND_OP
if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
- if (type != BP_VAR_IS) {
- zend_error(E_NOTICE, "Trying to get property of non-object");
- }
+ zend_error(E_NOTICE, "Trying to get property of non-object");
*retval = EG(uninitialized_zval_ptr);
SELECTIVE_PZVAL_LOCK(*retval, &opline->result);
AI_USE_PTR(EX_T(opline->result.u.var).var);
@@ -25363,9 +25287,7 @@ static int zend_fetch_property_address_read_helper_SPEC_CV_CV(int type, ZEND_OPC
if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
- if (type != BP_VAR_IS) {
- zend_error(E_NOTICE, "Trying to get property of non-object");
- }
+ zend_error(E_NOTICE, "Trying to get property of non-object");
*retval = EG(uninitialized_zval_ptr);
SELECTIVE_PZVAL_LOCK(*retval, &opline->result);
AI_USE_PTR(EX_T(opline->result.u.var).var);