summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2010-04-20 10:57:45 (GMT)
committerDmitry Stogov <dmitry@php.net>2010-04-20 10:57:45 (GMT)
commit94dd83722b57c4613ccf8371a3c4f50ffc274584 (patch)
tree6e970bfc8b071f92e8d55dcb0b33cff24c857c91 /Zend
parentea53dc5af6a216b46a84944ee870c5ce18dcfe90 (diff)
downloadphp-94dd83722b57c4613ccf8371a3c4f50ffc274584.tar.gz
Changed the structure of op_array.opcodes. The constant values are moved from opcode operands into a separate literal table
Diffstat (limited to 'Zend')
-rw-r--r--Zend/zend.c18
-rw-r--r--Zend/zend_API.c34
-rw-r--r--Zend/zend_builtin_functions.c10
-rw-r--r--Zend/zend_closures.c18
-rw-r--r--Zend/zend_compile.c1296
-rw-r--r--Zend/zend_compile.h106
-rw-r--r--Zend/zend_execute.c171
-rw-r--r--Zend/zend_execute.h7
-rw-r--r--Zend/zend_execute_API.c98
-rw-r--r--Zend/zend_hash.h11
-rw-r--r--Zend/zend_language_parser.y84
-rw-r--r--Zend/zend_object_handlers.c151
-rw-r--r--Zend/zend_object_handlers.h19
-rw-r--r--Zend/zend_objects_API.c4
-rw-r--r--Zend/zend_opcode.c51
-rw-r--r--Zend/zend_vm_def.h1013
-rw-r--r--Zend/zend_vm_execute.h9853
-rw-r--r--Zend/zend_vm_gen.php76
18 files changed, 6835 insertions, 6185 deletions
diff --git a/Zend/zend.c b/Zend/zend.c
index c3aaec5..53bae4c 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -464,19 +464,19 @@ static void zend_init_exception_op(TSRMLS_D) /* {{{ */
{
memset(EG(exception_op), 0, sizeof(EG(exception_op)));
EG(exception_op)[0].opcode = ZEND_HANDLE_EXCEPTION;
- EG(exception_op)[0].op1.op_type = IS_UNUSED;
- EG(exception_op)[0].op2.op_type = IS_UNUSED;
- EG(exception_op)[0].result.op_type = IS_UNUSED;
+ EG(exception_op)[0].op1_type = IS_UNUSED;
+ EG(exception_op)[0].op2_type = IS_UNUSED;
+ EG(exception_op)[0].result_type = IS_UNUSED;
ZEND_VM_SET_OPCODE_HANDLER(EG(exception_op));
EG(exception_op)[1].opcode = ZEND_HANDLE_EXCEPTION;
- EG(exception_op)[1].op1.op_type = IS_UNUSED;
- EG(exception_op)[1].op2.op_type = IS_UNUSED;
- EG(exception_op)[1].result.op_type = IS_UNUSED;
+ EG(exception_op)[1].op1_type = IS_UNUSED;
+ EG(exception_op)[1].op2_type = IS_UNUSED;
+ EG(exception_op)[1].result_type = IS_UNUSED;
ZEND_VM_SET_OPCODE_HANDLER(EG(exception_op)+1);
EG(exception_op)[2].opcode = ZEND_HANDLE_EXCEPTION;
- EG(exception_op)[2].op1.op_type = IS_UNUSED;
- EG(exception_op)[2].op2.op_type = IS_UNUSED;
- EG(exception_op)[2].result.op_type = IS_UNUSED;
+ EG(exception_op)[2].op1_type = IS_UNUSED;
+ EG(exception_op)[2].op2_type = IS_UNUSED;
+ EG(exception_op)[2].result_type = IS_UNUSED;
ZEND_VM_SET_OPCODE_HANDLER(EG(exception_op)+2);
}
/* }}} */
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 5433dc1..c08e43d 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -971,7 +971,7 @@ static int zend_merge_property(zval **value TSRMLS_DC, int num_args, va_list arg
MAKE_STD_ZVAL(member);
ZVAL_STRINGL(member, hash_key->arKey, hash_key->nKeyLength-1, 1);
- obj_ht->write_property(obj, member, *value TSRMLS_CC);
+ obj_ht->write_property(obj, member, *value, 0 TSRMLS_CC);
zval_ptr_dtor(&member);
}
return ZEND_HASH_APPLY_KEEP;
@@ -1435,7 +1435,7 @@ ZEND_API int add_property_long_ex(zval *arg, const char *key, uint key_len, long
MAKE_STD_ZVAL(z_key);
ZVAL_STRINGL(z_key, key, key_len-1, 1);
- Z_OBJ_HANDLER_P(arg, write_property)(arg, z_key, tmp TSRMLS_CC);
+ Z_OBJ_HANDLER_P(arg, write_property)(arg, z_key, tmp, 0 TSRMLS_CC);
zval_ptr_dtor(&tmp); /* write_property will add 1 to refcount */
zval_ptr_dtor(&z_key);
return SUCCESS;
@@ -1453,7 +1453,7 @@ ZEND_API int add_property_bool_ex(zval *arg, const char *key, uint key_len, int
MAKE_STD_ZVAL(z_key);
ZVAL_STRINGL(z_key, key, key_len-1, 1);
- Z_OBJ_HANDLER_P(arg, write_property)(arg, z_key, tmp TSRMLS_CC);
+ Z_OBJ_HANDLER_P(arg, write_property)(arg, z_key, tmp, 0 TSRMLS_CC);
zval_ptr_dtor(&tmp); /* write_property will add 1 to refcount */
zval_ptr_dtor(&z_key);
return SUCCESS;
@@ -1471,7 +1471,7 @@ ZEND_API int add_property_null_ex(zval *arg, const char *key, uint key_len TSRML
MAKE_STD_ZVAL(z_key);
ZVAL_STRINGL(z_key, key, key_len-1, 1);
- Z_OBJ_HANDLER_P(arg, write_property)(arg, z_key, tmp TSRMLS_CC);
+ Z_OBJ_HANDLER_P(arg, write_property)(arg, z_key, tmp, 0 TSRMLS_CC);
zval_ptr_dtor(&tmp); /* write_property will add 1 to refcount */
zval_ptr_dtor(&z_key);
return SUCCESS;
@@ -1489,7 +1489,7 @@ ZEND_API int add_property_resource_ex(zval *arg, const char *key, uint key_len,
MAKE_STD_ZVAL(z_key);
ZVAL_STRINGL(z_key, key, key_len-1, 1);
- Z_OBJ_HANDLER_P(arg, write_property)(arg, z_key, tmp TSRMLS_CC);
+ Z_OBJ_HANDLER_P(arg, write_property)(arg, z_key, tmp, 0 TSRMLS_CC);
zval_ptr_dtor(&tmp); /* write_property will add 1 to refcount */
zval_ptr_dtor(&z_key);
return SUCCESS;
@@ -1507,7 +1507,7 @@ ZEND_API int add_property_double_ex(zval *arg, const char *key, uint key_len, do
MAKE_STD_ZVAL(z_key);
ZVAL_STRINGL(z_key, key, key_len-1, 1);
- Z_OBJ_HANDLER_P(arg, write_property)(arg, z_key, tmp TSRMLS_CC);
+ Z_OBJ_HANDLER_P(arg, write_property)(arg, z_key, tmp, 0 TSRMLS_CC);
zval_ptr_dtor(&tmp); /* write_property will add 1 to refcount */
zval_ptr_dtor(&z_key);
return SUCCESS;
@@ -1525,7 +1525,7 @@ ZEND_API int add_property_string_ex(zval *arg, const char *key, uint key_len, ch
MAKE_STD_ZVAL(z_key);
ZVAL_STRINGL(z_key, key, key_len-1, 1);
- Z_OBJ_HANDLER_P(arg, write_property)(arg, z_key, tmp TSRMLS_CC);
+ Z_OBJ_HANDLER_P(arg, write_property)(arg, z_key, tmp, 0 TSRMLS_CC);
zval_ptr_dtor(&tmp); /* write_property will add 1 to refcount */
zval_ptr_dtor(&z_key);
return SUCCESS;
@@ -1543,7 +1543,7 @@ ZEND_API int add_property_stringl_ex(zval *arg, const char *key, uint key_len, c
MAKE_STD_ZVAL(z_key);
ZVAL_STRINGL(z_key, key, key_len-1, 1);
- Z_OBJ_HANDLER_P(arg, write_property)(arg, z_key, tmp TSRMLS_CC);
+ Z_OBJ_HANDLER_P(arg, write_property)(arg, z_key, tmp, 0 TSRMLS_CC);
zval_ptr_dtor(&tmp); /* write_property will add 1 to refcount */
zval_ptr_dtor(&z_key);
return SUCCESS;
@@ -1557,7 +1557,7 @@ ZEND_API int add_property_zval_ex(zval *arg, const char *key, uint key_len, zval
MAKE_STD_ZVAL(z_key);
ZVAL_STRINGL(z_key, key, key_len-1, 1);
- Z_OBJ_HANDLER_P(arg, write_property)(arg, z_key, value TSRMLS_CC);
+ Z_OBJ_HANDLER_P(arg, write_property)(arg, z_key, value, 0 TSRMLS_CC);
zval_ptr_dtor(&z_key);
return SUCCESS;
}
@@ -1893,7 +1893,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
}
}
fname_len = strlen(ptr->fname);
- lowercase_name = zend_str_tolower_dup(ptr->fname, fname_len);
+ lowercase_name = zend_str_tolower_dup(ptr->fname, fname_len);
if (zend_hash_add(target_function_table, lowercase_name, fname_len+1, &function, sizeof(zend_function), (void**)&reg_function) == FAILURE) {
unload=1;
efree(lowercase_name);
@@ -2381,7 +2381,7 @@ static int zend_is_callable_check_class(const char *name, int name_len, zend_fca
*strict_class = 1;
ret = 1;
}
- } else if (zend_lookup_class_ex(name, name_len, 1, &pce TSRMLS_CC) == SUCCESS) {
+ } else if (zend_lookup_class_ex(name, name_len, NULL, 1, &pce TSRMLS_CC) == SUCCESS) {
zend_class_entry *scope = EG(active_op_array) ? EG(active_op_array)->scope : NULL;
fcc->calling_scope = *pce;
@@ -2546,7 +2546,7 @@ get_function_via_handler:
call_via_handler = 1;
retval = 1;
} else if (Z_OBJ_HT_P(fcc->object_ptr)->get_method) {
- fcc->function_handler = Z_OBJ_HT_P(fcc->object_ptr)->get_method(&fcc->object_ptr, mname, mlen TSRMLS_CC);
+ fcc->function_handler = Z_OBJ_HT_P(fcc->object_ptr)->get_method(&fcc->object_ptr, mname, mlen, NULL TSRMLS_CC);
if (fcc->function_handler) {
if (strict_class &&
(!fcc->function_handler->common.scope ||
@@ -2567,7 +2567,7 @@ get_function_via_handler:
if (fcc->calling_scope->get_static_method) {
fcc->function_handler = fcc->calling_scope->get_static_method(fcc->calling_scope, mname, mlen TSRMLS_CC);
} else {
- fcc->function_handler = zend_std_get_static_method(fcc->calling_scope, mname, mlen TSRMLS_CC);
+ fcc->function_handler = zend_std_get_static_method(fcc->calling_scope, mname, mlen, NULL TSRMLS_CC);
}
if (fcc->function_handler) {
retval = 1;
@@ -3343,7 +3343,7 @@ ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char *
}
MAKE_STD_ZVAL(property);
ZVAL_STRINGL(property, name, name_length, 1);
- Z_OBJ_HT_P(object)->write_property(object, property, value TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, value, 0 TSRMLS_CC);
zval_ptr_dtor(&property);
EG(scope) = old_scope;
@@ -3428,7 +3428,7 @@ ZEND_API int zend_update_static_property(zend_class_entry *scope, char *name, in
zend_class_entry *old_scope = EG(scope);
EG(scope) = scope;
- property = zend_std_get_static_property(scope, name, name_length, 0 TSRMLS_CC);
+ property = zend_std_get_static_property(scope, name, name_length, 0, NULL TSRMLS_CC);
EG(scope) = old_scope;
if (!property) {
return FAILURE;
@@ -3546,7 +3546,7 @@ ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, char *n
MAKE_STD_ZVAL(property);
ZVAL_STRINGL(property, name, name_length, 1);
- value = Z_OBJ_HT_P(object)->read_property(object, property, silent?BP_VAR_IS:BP_VAR_R TSRMLS_CC);
+ value = Z_OBJ_HT_P(object)->read_property(object, property, silent?BP_VAR_IS:BP_VAR_R, 0 TSRMLS_CC);
zval_ptr_dtor(&property);
EG(scope) = old_scope;
@@ -3560,7 +3560,7 @@ ZEND_API zval *zend_read_static_property(zend_class_entry *scope, char *name, in
zend_class_entry *old_scope = EG(scope);
EG(scope) = scope;
- property = zend_std_get_static_property(scope, name, name_length, silent TSRMLS_CC);
+ property = zend_std_get_static_property(scope, name, name_length, silent, NULL TSRMLS_CC);
EG(scope) = old_scope;
return property?*property:NULL;
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index 0807341..ce4a1be 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -839,7 +839,7 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass)
RETURN_FALSE;
}
- if (zend_lookup_class_ex(class_name, class_name_len, 0, &ce TSRMLS_CC) == FAILURE) {
+ if (zend_lookup_class_ex(class_name, class_name_len, NULL, 0, &ce TSRMLS_CC) == FAILURE) {
retval = 0;
} else {
if (only_subclass) {
@@ -1102,7 +1102,7 @@ ZEND_FUNCTION(method_exists)
if (Z_TYPE_P(klass) == IS_OBJECT
&& Z_OBJ_HT_P(klass)->get_method != NULL
- && (func = Z_OBJ_HT_P(klass)->get_method(&klass, method_name, method_len TSRMLS_CC)) != NULL
+ && (func = Z_OBJ_HT_P(klass)->get_method(&klass, method_name, method_len, NULL TSRMLS_CC)) != NULL
) {
if (func->type == ZEND_INTERNAL_FUNCTION
&& ((zend_internal_function*)func)->handler == zend_std_call_user_call
@@ -1160,7 +1160,7 @@ ZEND_FUNCTION(property_exists)
if (Z_TYPE_P(object) == IS_OBJECT &&
Z_OBJ_HANDLER_P(object, has_property) &&
- Z_OBJ_HANDLER_P(object, has_property)(object, &property_z, 2 TSRMLS_CC)) {
+ Z_OBJ_HANDLER_P(object, has_property)(object, &property_z, 2, 0 TSRMLS_CC)) {
RETURN_TRUE;
}
RETURN_FALSE;
@@ -2021,7 +2021,7 @@ ZEND_FUNCTION(debug_print_backtrace)
function_name = "unknown";
build_filename_arg = 0;
} else
- switch (Z_LVAL(ptr->opline->op2.u.constant)) {
+ switch (ptr->opline->extended_value) {
case ZEND_EVAL:
function_name = "eval";
build_filename_arg = 0;
@@ -2204,7 +2204,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
function_name = "unknown";
build_filename_arg = 0;
} else
- switch (ptr->opline->op2.u.constant.value.lval) {
+ switch (ptr->opline->extended_value) {
case ZEND_EVAL:
function_name = "eval";
build_filename_arg = 0;
diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c
index 20632e3..4d325d1 100644
--- a/Zend/zend_closures.c
+++ b/Zend/zend_closures.c
@@ -152,7 +152,7 @@ ZEND_API zval* zend_get_closure_this_ptr(zval *obj TSRMLS_DC) /* {{{ */
}
/* }}} */
-static zend_function *zend_closure_get_method(zval **object_ptr, char *method_name, int method_len TSRMLS_DC) /* {{{ */
+static zend_function *zend_closure_get_method(zval **object_ptr, char *method_name, int method_len, const zend_literal *key TSRMLS_DC) /* {{{ */
{
char *lc_name;
ALLOCA_FLAG(use_heap)
@@ -166,11 +166,11 @@ static zend_function *zend_closure_get_method(zval **object_ptr, char *method_na
return zend_get_closure_invoke_method(*object_ptr TSRMLS_CC);
}
free_alloca(lc_name, use_heap);
- return std_object_handlers.get_method(object_ptr, method_name, method_len TSRMLS_CC);
+ return std_object_handlers.get_method(object_ptr, method_name, method_len, key TSRMLS_CC);
}
/* }}} */
-static zval *zend_closure_read_property(zval *object, zval *member, int type TSRMLS_DC) /* {{{ */
+static zval *zend_closure_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC) /* {{{ */
{
ZEND_CLOSURE_PROPERTY_ERROR();
Z_ADDREF(EG(uninitialized_zval));
@@ -178,20 +178,20 @@ static zval *zend_closure_read_property(zval *object, zval *member, int type TSR
}
/* }}} */
-static void zend_closure_write_property(zval *object, zval *member, zval *value TSRMLS_DC) /* {{{ */
+static void zend_closure_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC) /* {{{ */
{
ZEND_CLOSURE_PROPERTY_ERROR();
}
/* }}} */
-static zval **zend_closure_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC) /* {{{ */
+static zval **zend_closure_get_property_ptr_ptr(zval *object, zval *member, const zend_literal *key TSRMLS_DC) /* {{{ */
{
ZEND_CLOSURE_PROPERTY_ERROR();
return NULL;
}
/* }}} */
-static int zend_closure_has_property(zval *object, zval *member, int has_set_exists TSRMLS_DC) /* {{{ */
+static int zend_closure_has_property(zval *object, zval *member, int has_set_exists, const zend_literal *key TSRMLS_DC) /* {{{ */
{
if (has_set_exists != 2) {
ZEND_CLOSURE_PROPERTY_ERROR();
@@ -200,7 +200,7 @@ static int zend_closure_has_property(zval *object, zval *member, int has_set_exi
}
/* }}} */
-static void zend_closure_unset_property(zval *object, zval *member TSRMLS_DC) /* {{{ */
+static void zend_closure_unset_property(zval *object, zval *member, const zend_literal *key TSRMLS_DC) /* {{{ */
{
ZEND_CLOSURE_PROPERTY_ERROR();
}
@@ -308,7 +308,7 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp TSRMLS_
MAKE_STD_ZVAL(val);
array_init(val);
zend_hash_copy(Z_ARRVAL_P(val), static_variables, (copy_ctor_func_t)zval_add_ref, NULL, sizeof(zval*));
- zend_symtable_update(closure->debug_info, "static", sizeof("static"), (void *) &val, sizeof(zval *), NULL);
+ zend_hash_update(closure->debug_info, "static", sizeof("static"), (void *) &val, sizeof(zval *), NULL);
}
if (closure->this_ptr) {
@@ -340,7 +340,7 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp TSRMLS_
efree(name);
arg_info++;
}
- zend_symtable_update(closure->debug_info, "parameter", sizeof("parameter"), (void *) &val, sizeof(zval *), NULL);
+ zend_hash_update(closure->debug_info, "parameter", sizeof("parameter"), (void *) &val, sizeof(zval *), NULL);
}
}
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 619415d..5a57f8e 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -32,6 +32,37 @@
#include "zend_multibyte.h"
#endif /* ZEND_MULTIBYTE */
+#define CONSTANT_EX(op_array, op) \
+ (op_array)->literals[op].constant
+
+#define CONSTANT(op) \
+ CONSTANT_EX(CG(active_op_array), op)
+
+#define SET_NODE(target, src) do { \
+ target ## _type = (src)->op_type; \
+ if ((src)->op_type == IS_CONST) { \
+ target.constant = zend_add_literal(CG(active_op_array), &(src)->u.constant); \
+ } else { \
+ target = (src)->u.op; \
+ } \
+ } while (0)
+
+#define GET_NODE(target, src) do { \
+ (target)->op_type = src ## _type; \
+ if ((target)->op_type == IS_CONST) { \
+ (target)->u.constant = CONSTANT(src.constant); \
+ } else { \
+ (target)->u.op = src; \
+ (target)->EA = 0; \
+ } \
+ } while (0)
+
+#define COPY_NODE(target, src) do { \
+ target ## _type = src ## _type; \
+ target = src; \
+ } while (0)
+
+
ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC);
ZEND_API zend_op_array *(*zend_compile_string)(zval *source_string, char *filename TSRMLS_DC);
@@ -288,17 +319,66 @@ static int lookup_cv(zend_op_array *op_array, char* name, int name_len) /* {{{ *
}
/* }}} */
+void zend_del_literal(zend_op_array *op_array, int n) /* {{{ */
+{
+ zval_dtor(&CONSTANT_EX(op_array, n));
+ if (n + 1 == op_array->last_literal) {
+ op_array->last_literal--;
+ } else {
+ Z_TYPE(CONSTANT_EX(op_array, n)) = IS_NULL;
+ }
+}
+/* }}} */
+int zend_add_literal(zend_op_array *op_array, const zval *zv) /* {{{ */
+{
+ int i = op_array->last_literal;
+ op_array->last_literal++;
+ if (i >= op_array->size_literal) {
+ op_array->size_literal += 16; /* FIXME */
+ op_array->literals = (zend_literal*)erealloc(op_array->literals, op_array->size_literal * sizeof(zend_literal));
+ }
+ CONSTANT_EX(op_array, i) = *zv;
+ Z_SET_REFCOUNT(CONSTANT_EX(op_array, i), 2);
+ Z_SET_ISREF(CONSTANT_EX(op_array, i));
+ return i;
+}
+/* }}} */
+
+#define LITERAL_STRINGL(op, str, len, copy) do { \
+ zval _c; \
+ ZVAL_STRINGL(&_c, str, len, copy); \
+ op.constant = zend_add_literal(CG(active_op_array), &_c); \
+ } while (0)
+
+#define LITERAL_LONG(op, val) do { \
+ zval _c; \
+ ZVAL_LONG(&_c, val); \
+ op.constant = zend_add_literal(CG(active_op_array), &_c); \
+ } while (0)
+
+#define LITERAL_LONG_EX(op_array, op, val) do { \
+ zval _c; \
+ ZVAL_LONG(&_c, val); \
+ op.constant = zend_add_literal(op_array, &_c); \
+ } while (0)
+
+#define LITERAL_NULL(op) do { \
+ zval _c; \
+ INIT_ZVAL( _c); \
+ op.constant = zend_add_literal(CG(active_op_array), &_c); \
+ } while (0)
+
void zend_do_binary_op(zend_uchar op, znode *result, const znode *op1, const znode *op2 TSRMLS_DC) /* {{{ */
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = op;
- opline->result.op_type = IS_TMP_VAR;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- opline->op1 = *op1;
- opline->op2 = *op2;
- *result = opline->result;
+ opline->result_type = IS_TMP_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ SET_NODE(opline->op1, op1);
+ SET_NODE(opline->op2, op2);
+ GET_NODE(result, opline->result);
}
/* }}} */
@@ -307,21 +387,21 @@ void zend_do_unary_op(zend_uchar op, znode *result, const znode *op1 TSRMLS_DC)
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = op;
- opline->result.op_type = IS_TMP_VAR;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- opline->op1 = *op1;
- *result = opline->result;
+ opline->result_type = IS_TMP_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ SET_NODE(opline->op1, op1);
+ GET_NODE(result, opline->result);
SET_UNUSED(opline->op2);
}
/* }}} */
-#define MAKE_NOP(opline) { opline->opcode = ZEND_NOP; memset(&opline->result,0,sizeof(znode)); memset(&opline->op1,0,sizeof(znode)); memset(&opline->op2,0,sizeof(znode)); opline->result.op_type=opline->op1.op_type=opline->op2.op_type=IS_UNUSED; }
+#define MAKE_NOP(opline) { opline->opcode = ZEND_NOP; memset(&opline->result,0,sizeof(opline->result)); memset(&opline->op1,0,sizeof(opline->op1)); memset(&opline->op2,0,sizeof(opline->op2)); opline->result_type=opline->op1_type=opline->op2_type=IS_UNUSED; }
static void zend_do_op_data(zend_op *data_op, const znode *value TSRMLS_DC) /* {{{ */
{
data_op->opcode = ZEND_OP_DATA;
- data_op->op1 = *value;
+ SET_NODE(data_op->op1, value);
SET_UNUSED(data_op->op2);
}
/* }}} */
@@ -341,18 +421,17 @@ void zend_do_binary_assign_op(zend_uchar op, znode *result, const znode *op1, co
zend_do_op_data(opline, op2 TSRMLS_CC);
SET_UNUSED(opline->result);
- *result = last_op->result;
+ GET_NODE(result, last_op->result);
return;
case ZEND_FETCH_DIM_RW:
last_op->opcode = op;
last_op->extended_value = ZEND_ASSIGN_DIM;
zend_do_op_data(opline, op2 TSRMLS_CC);
- opline->op2.u.var = get_temporary_variable(CG(active_op_array));
- opline->op2.u.EA.type = 0;
- opline->op2.op_type = IS_VAR;
+ opline->op2.var = get_temporary_variable(CG(active_op_array));
+ opline->op2_type = IS_VAR;
SET_UNUSED(opline->result);
- *result = last_op->result;
+ GET_NODE(result,last_op->result);
return;
default:
break;
@@ -360,12 +439,11 @@ void zend_do_binary_assign_op(zend_uchar op, znode *result, const znode *op1, co
}
opline->opcode = op;
- opline->op1 = *op1;
- opline->op2 = *op2;
- opline->result.op_type = IS_VAR;
- opline->result.u.EA.type = 0;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- *result = opline->result;
+ SET_NODE(opline->op1, op1);
+ SET_NODE(opline->op2, op2);
+ opline->result_type = IS_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ GET_NODE(result, opline->result);
}
/* }}} */
@@ -385,8 +463,8 @@ void fetch_simple_variable_ex(znode *result, znode *varname, int bp, zend_uchar
(CG(active_op_array)->last == 0 ||
CG(active_op_array)->opcodes[CG(active_op_array)->last-1].opcode != ZEND_BEGIN_SILENCE)) {
result->op_type = IS_CV;
- result->u.var = lookup_cv(CG(active_op_array), varname->u.constant.value.str.val, varname->u.constant.value.str.len);
- result->u.EA.type = 0;
+ result->u.op.var = lookup_cv(CG(active_op_array), varname->u.constant.value.str.val, varname->u.constant.value.str.len);
+ result->EA = 0;
return;
}
}
@@ -399,17 +477,17 @@ void fetch_simple_variable_ex(znode *result, znode *varname, int bp, zend_uchar
}
opline_ptr->opcode = op;
- opline_ptr->result.op_type = IS_VAR;
- opline_ptr->result.u.EA.type = 0;
- opline_ptr->result.u.var = get_temporary_variable(CG(active_op_array));
- opline_ptr->op1 = *varname;
- *result = opline_ptr->result;
+ opline_ptr->result_type = IS_VAR;
+ opline_ptr->result.var = get_temporary_variable(CG(active_op_array));
+ SET_NODE(opline_ptr->op1, varname);
+ GET_NODE(result, opline_ptr->result);
SET_UNUSED(opline_ptr->op2);
+ opline_ptr->extended_value = ZEND_FETCH_LOCAL;
- opline_ptr->op2.u.EA.type = ZEND_FETCH_LOCAL;
- if (varname->op_type == IS_CONST && varname->u.constant.type == IS_STRING) {
+ if (varname->op_type == IS_CONST) {
+ Z_HASH_P(&CONSTANT(opline_ptr->op1.constant)) = zend_hash_func(Z_STRVAL(CONSTANT(opline_ptr->op1.constant)), Z_STRLEN(CONSTANT(opline_ptr->op1.constant))+1);
if (zend_is_auto_global(varname->u.constant.value.str.val, varname->u.constant.value.str.len TSRMLS_CC)) {
- opline_ptr->op2.u.EA.type = ZEND_FETCH_GLOBAL;
+ opline_ptr->extended_value = ZEND_FETCH_GLOBAL;
}
}
@@ -441,42 +519,39 @@ void zend_do_fetch_static_member(znode *result, znode *class_name TSRMLS_DC) /*
init_op(&opline TSRMLS_CC);
opline.opcode = ZEND_FETCH_W;
- opline.result.op_type = IS_VAR;
- opline.result.u.EA.type = 0;
- opline.result.u.var = get_temporary_variable(CG(active_op_array));
- opline.op1.op_type = IS_CONST;
- opline.op1.u.constant.type = IS_STRING;
- opline.op1.u.constant.value.str.val = estrdup(CG(active_op_array)->vars[result->u.var].name);
- opline.op1.u.constant.value.str.len = CG(active_op_array)->vars[result->u.var].name_len;
+ opline.result_type = IS_VAR;
+ opline.result.var = get_temporary_variable(CG(active_op_array));
+ opline.op1_type = IS_CONST;
+ LITERAL_STRINGL(opline.op1, estrdup(CG(active_op_array)->vars[result->u.op.var].name), CG(active_op_array)->vars[result->u.op.var].name_len, 0);
+ Z_HASH_P(&CONSTANT(opline.op1.constant)) = zend_hash_func(Z_STRVAL(CONSTANT(opline.op1.constant)), Z_STRLEN(CONSTANT(opline.op1.constant))+1);
SET_UNUSED(opline.op2);
- opline.op2 = class_node;
- opline.op2.u.EA.type = ZEND_FETCH_STATIC_MEMBER;
- *result = opline.result;
+ SET_NODE(opline.op2, &class_node);
+ GET_NODE(result,opline.result);
+ opline.extended_value |= ZEND_FETCH_STATIC_MEMBER;
+ opline_ptr = &opline;
zend_llist_add_element(fetch_list_ptr, &opline);
} else {
le = fetch_list_ptr->head;
opline_ptr = (zend_op *)le->data;
- if (opline_ptr->opcode != ZEND_FETCH_W && opline_ptr->op1.op_type == IS_CV) {
+ if (opline_ptr->opcode != ZEND_FETCH_W && opline_ptr->op1_type == IS_CV) {
init_op(&opline TSRMLS_CC);
opline.opcode = ZEND_FETCH_W;
- opline.result.op_type = IS_VAR;
- opline.result.u.EA.type = 0;
- opline.result.u.var = get_temporary_variable(CG(active_op_array));
- opline.op1.op_type = IS_CONST;
- opline.op1.u.constant.type = IS_STRING;
- opline.op1.u.constant.value.str.val = estrdup(CG(active_op_array)->vars[opline_ptr->op1.u.var].name);
- opline.op1.u.constant.value.str.len = CG(active_op_array)->vars[opline_ptr->op1.u.var].name_len;
+ opline.result_type = IS_VAR;
+ opline.result.var = get_temporary_variable(CG(active_op_array));
+ opline.op1_type = IS_CONST;
+ LITERAL_STRINGL(opline.op1, estrdup(CG(active_op_array)->vars[opline_ptr->op1.var].name), CG(active_op_array)->vars[opline_ptr->op1.var].name_len, 0);
+ Z_HASH_P(&CONSTANT(opline.op1.constant)) = zend_hash_func(Z_STRVAL(CONSTANT(opline.op1.constant)), Z_STRLEN(CONSTANT(opline.op1.constant))+1);
SET_UNUSED(opline.op2);
- opline.op2 = class_node;
- opline.op2.u.EA.type = ZEND_FETCH_STATIC_MEMBER;
- opline_ptr->op1 = opline.result;
+ SET_NODE(opline.op2, &class_node);
+ opline.extended_value |= ZEND_FETCH_STATIC_MEMBER;
+ COPY_NODE(opline_ptr->op1, opline.result);
zend_llist_prepend_element(fetch_list_ptr, &opline);
} else {
- opline_ptr->op2 = class_node;
- opline_ptr->op2.u.EA.type = ZEND_FETCH_STATIC_MEMBER;
+ SET_NODE(opline_ptr->op2, &class_node);
+ opline_ptr->extended_value |= ZEND_FETCH_STATIC_MEMBER;
}
}
}
@@ -497,13 +572,24 @@ void fetch_array_dim(znode *result, const znode *parent, const znode *dim TSRMLS
init_op(&opline TSRMLS_CC);
opline.opcode = ZEND_FETCH_DIM_W; /* the backpatching routine assumes W */
- opline.result.op_type = IS_VAR;
- opline.result.u.EA.type = 0;
- opline.result.u.var = get_temporary_variable(CG(active_op_array));
- opline.op1 = *parent;
- opline.op2 = *dim;
- opline.extended_value = ZEND_FETCH_STANDARD;
- *result = opline.result;
+ opline.result_type = IS_VAR;
+ opline.result.var = get_temporary_variable(CG(active_op_array));
+ SET_NODE(opline.op1, parent);
+ SET_NODE(opline.op2, dim);
+ if (opline.op2_type == IS_CONST && Z_TYPE(CONSTANT(opline.op2.constant)) == IS_STRING) {
+ long index;
+ int numeric = 0;
+
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL(CONSTANT(opline.op2.constant)), Z_STRLEN(CONSTANT(opline.op2.constant))+1, index, numeric = 1);
+ if (numeric) {
+ zval_dtor(&CONSTANT(opline.op2.constant));
+ ZVAL_LONG(&CONSTANT(opline.op2.constant), index);
+ } else {
+ Z_HASH_P(&CONSTANT(opline.op2.constant)) = zend_hash_func(Z_STRVAL(CONSTANT(opline.op2.constant)), Z_STRLEN(CONSTANT(opline.op2.constant))+1);
+ }
+ }
+
+ GET_NODE(result, opline.result);
zend_stack_top(&CG(bp_stack), (void **) &fetch_list_ptr);
zend_llist_add_element(fetch_list_ptr, &opline);
@@ -520,12 +606,12 @@ void zend_do_print(znode *result, const znode *arg TSRMLS_DC) /* {{{ */
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
- opline->result.op_type = IS_TMP_VAR;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
+ opline->result_type = IS_TMP_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
opline->opcode = ZEND_PRINT;
- opline->op1 = *arg;
+ SET_NODE(opline->op1, arg);
SET_UNUSED(opline->op2);
- *result = opline->result;
+ GET_NODE(result, opline->result);
}
/* }}} */
@@ -534,7 +620,7 @@ void zend_do_echo(const znode *arg TSRMLS_DC) /* {{{ */
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_ECHO;
- opline->op1 = *arg;
+ SET_NODE(opline->op1, arg);
SET_UNUSED(opline->op2);
}
/* }}} */
@@ -574,10 +660,10 @@ void zend_do_abstract_method(const znode *function_name, znode *modifiers, const
static zend_bool opline_is_fetch_this(const zend_op *opline TSRMLS_DC) /* {{{ */
{
- if ((opline->opcode == ZEND_FETCH_W) && (opline->op1.op_type == IS_CONST)
- && (opline->op1.u.constant.type == IS_STRING)
- && (opline->op1.u.constant.value.str.len == (sizeof("this")-1))
- && !memcmp(opline->op1.u.constant.value.str.val, "this", sizeof("this"))) {
+ if ((opline->opcode == ZEND_FETCH_W) && (opline->op1_type == IS_CONST)
+ && (Z_TYPE(CONSTANT(opline->op1.constant)) == IS_STRING)
+ && (Z_STRLEN(CONSTANT(opline->op1.constant)) == (sizeof("this")-1))
+ && !memcmp(Z_STRVAL(CONSTANT(opline->op1.constant)), "this", sizeof("this"))) {
return 1;
} else {
return 0;
@@ -585,7 +671,7 @@ static zend_bool opline_is_fetch_this(const zend_op *opline TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_do_assign(znode *result, znode *variable, const znode *value TSRMLS_DC) /* {{{ */
+void zend_do_assign(znode *result, znode *variable, znode *value TSRMLS_DC) /* {{{ */
{
int last_op_number;
zend_op *opline;
@@ -598,21 +684,21 @@ void zend_do_assign(znode *result, znode *variable, const znode *value TSRMLS_DC
opline = (zend_op *)fetch_list_ptr->head->data;
if (opline->opcode == ZEND_FETCH_DIM_W &&
- opline->op1.op_type == IS_CV &&
- opline->op1.u.var == value->u.var) {
+ opline->op1_type == IS_CV &&
+ opline->op1.var == value->u.op.var) {
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_FETCH_R;
- opline->result.op_type = IS_VAR;
- opline->result.u.EA.type = 0;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- opline->op1.op_type = IS_CONST;
- ZVAL_STRINGL(&opline->op1.u.constant,
- CG(active_op_array)->vars[value->u.var].name,
- CG(active_op_array)->vars[value->u.var].name_len, 1);
+ opline->result_type = IS_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ opline->op1_type = IS_CONST;
+ LITERAL_STRINGL(opline->op1,
+ CG(active_op_array)->vars[value->u.op.var].name,
+ CG(active_op_array)->vars[value->u.op.var].name_len, 1);
+ Z_HASH_P(&CONSTANT(opline->op1.constant)) = zend_hash_func(Z_STRVAL(CONSTANT(opline->op1.constant)), Z_STRLEN(CONSTANT(opline->op1.constant))+1);
SET_UNUSED(opline->op2);
- opline->op2.u.EA.type = ZEND_FETCH_LOCAL;
- value = &opline->result;
+ opline->extended_value = ZEND_FETCH_LOCAL;
+ GET_NODE(value, opline->result);
}
}
}
@@ -623,7 +709,7 @@ void zend_do_assign(znode *result, znode *variable, const znode *value TSRMLS_DC
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
if (variable->op_type == IS_CV) {
- if (variable->u.var == CG(active_op_array)->this_var) {
+ if (variable->u.op.var == CG(active_op_array)->this_var) {
zend_error(E_COMPILE_ERROR, "Cannot re-assign $this");
}
} else if (variable->op_type == IS_VAR) {
@@ -634,8 +720,8 @@ void zend_do_assign(znode *result, znode *variable, const znode *value TSRMLS_DC
last_op = &CG(active_op_array)->opcodes[last_op_number-n-1];
- if (last_op->result.op_type == IS_VAR &&
- last_op->result.u.var == variable->u.var) {
+ if (last_op->result_type == IS_VAR &&
+ last_op->result.var == variable->u.op.var) {
if (last_op->opcode == ZEND_FETCH_OBJ_W) {
if (n > 0) {
int opline_no = (opline-CG(active_op_array)->opcodes)/sizeof(*opline);
@@ -649,7 +735,7 @@ void zend_do_assign(znode *result, znode *variable, const znode *value TSRMLS_DC
last_op->opcode = ZEND_ASSIGN_OBJ;
zend_do_op_data(opline, value TSRMLS_CC);
SET_UNUSED(opline->result);
- *result = last_op->result;
+ GET_NODE(result, last_op->result);
return;
} else if (last_op->opcode == ZEND_FETCH_DIM_W) {
if (n > 0) {
@@ -664,11 +750,10 @@ void zend_do_assign(znode *result, znode *variable, const znode *value TSRMLS_DC
}
last_op->opcode = ZEND_ASSIGN_DIM;
zend_do_op_data(opline, value TSRMLS_CC);
- opline->op2.u.var = get_temporary_variable(CG(active_op_array));
- opline->op2.u.EA.type = 0;
- opline->op2.op_type = IS_VAR;
+ opline->op2.var = get_temporary_variable(CG(active_op_array));
+ opline->op2_type = IS_VAR;
SET_UNUSED(opline->result);
- *result = last_op->result;
+ GET_NODE(result, last_op->result);
return;
} else if (opline_is_fetch_this(last_op TSRMLS_CC)) {
zend_error(E_COMPILE_ERROR, "Cannot re-assign $this");
@@ -681,18 +766,17 @@ void zend_do_assign(znode *result, znode *variable, const znode *value TSRMLS_DC
}
opline->opcode = ZEND_ASSIGN;
- opline->op1 = *variable;
- opline->op2 = *value;
- opline->result.op_type = IS_VAR;
- opline->result.u.EA.type = 0;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- *result = opline->result;
+ SET_NODE(opline->op1, variable);
+ SET_NODE(opline->op2, value);
+ opline->result_type = IS_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ GET_NODE(result, opline->result);
}
/* }}} */
static inline zend_bool zend_is_function_or_method_call(const znode *variable) /* {{{ */
{
- zend_uint type = variable->u.EA.type;
+ zend_uint type = variable->EA;
return ((type & ZEND_PARSED_METHOD_CALL) || (type == ZEND_PARSED_FUNCTION_CALL));
}
@@ -703,7 +787,7 @@ void zend_do_assign_ref(znode *result, const znode *lvar, const znode *rvar TSRM
zend_op *opline;
if (lvar->op_type == IS_CV) {
- if (lvar->u.var == CG(active_op_array)->this_var) {
+ if (lvar->u.op.var == CG(active_op_array)->this_var) {
zend_error(E_COMPILE_ERROR, "Cannot re-assign $this");
}
} else if (lvar->op_type == IS_VAR) {
@@ -721,22 +805,20 @@ void zend_do_assign_ref(znode *result, const znode *lvar, const znode *rvar TSRM
opline->opcode = ZEND_ASSIGN_REF;
if (zend_is_function_or_method_call(rvar)) {
opline->extended_value = ZEND_RETURNS_FUNCTION;
- } else if (rvar->u.EA.type & ZEND_PARSED_NEW) {
+ } else if (rvar->EA & ZEND_PARSED_NEW) {
opline->extended_value = ZEND_RETURNS_NEW;
} else {
opline->extended_value = 0;
}
if (result) {
- opline->result.op_type = IS_VAR;
- opline->result.u.EA.type = 0;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- *result = opline->result;
+ opline->result_type = IS_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ GET_NODE(result, opline->result);
} else {
- /* SET_UNUSED(opline->result); */
- opline->result.u.EA.type |= EXT_TYPE_UNUSED;
+ opline->result_type = IS_UNUSED | EXT_TYPE_UNUSED;
}
- opline->op1 = *lvar;
- opline->op2 = *rvar;
+ SET_NODE(opline->op1, lvar);
+ SET_NODE(opline->op2, rvar);
}
/* }}} */
@@ -773,8 +855,8 @@ void zend_do_while_cond(const znode *expr, znode *close_bracket_token TSRMLS_DC)
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_JMPZ;
- opline->op1 = *expr;
- close_bracket_token->u.opline_num = while_cond_op_number;
+ SET_NODE(opline->op1, expr);
+ close_bracket_token->u.op.opline_num = while_cond_op_number;
SET_UNUSED(opline->op2);
do_begin_loop(TSRMLS_C);
@@ -788,14 +870,14 @@ void zend_do_while_end(const znode *while_token, const znode *close_bracket_toke
/* add unconditional jump */
opline->opcode = ZEND_JMP;
- opline->op1.u.opline_num = while_token->u.opline_num;
+ opline->op1.opline_num = while_token->u.op.opline_num;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
/* update while's conditional jmp */
- CG(active_op_array)->opcodes[close_bracket_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array));
+ CG(active_op_array)->opcodes[close_bracket_token->u.op.opline_num].op2.opline_num = get_next_op_number(CG(active_op_array));
- do_end_loop(while_token->u.opline_num, 0 TSRMLS_CC);
+ do_end_loop(while_token->u.op.opline_num, 0 TSRMLS_CC);
DEC_BPC(CG(active_op_array));
}
@@ -807,8 +889,8 @@ void zend_do_for_cond(const znode *expr, znode *second_semicolon_token TSRMLS_DC
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_JMPZNZ;
- opline->op1 = *expr; /* the conditional expression */
- second_semicolon_token->u.opline_num = for_cond_op_number;
+ SET_NODE(opline->op1, expr); /* the conditional expression */
+ second_semicolon_token->u.op.opline_num = for_cond_op_number;
SET_UNUSED(opline->op2);
}
/* }}} */
@@ -818,8 +900,8 @@ void zend_do_for_before_statement(const znode *cond_start, const znode *second_s
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_JMP;
- opline->op1.u.opline_num = cond_start->u.opline_num;
- CG(active_op_array)->opcodes[second_semicolon_token->u.opline_num].extended_value = get_next_op_number(CG(active_op_array));
+ opline->op1.opline_num = cond_start->u.op.opline_num;
+ CG(active_op_array)->opcodes[second_semicolon_token->u.op.opline_num].extended_value = get_next_op_number(CG(active_op_array));
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
@@ -834,12 +916,12 @@ void zend_do_for_end(const znode *second_semicolon_token TSRMLS_DC) /* {{{ */
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_JMP;
- opline->op1.u.opline_num = second_semicolon_token->u.opline_num+1;
- CG(active_op_array)->opcodes[second_semicolon_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array));
+ opline->op1.opline_num = second_semicolon_token->u.op.opline_num+1;
+ CG(active_op_array)->opcodes[second_semicolon_token->u.op.opline_num].op2.opline_num = get_next_op_number(CG(active_op_array));
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
- do_end_loop(second_semicolon_token->u.opline_num+1, 0 TSRMLS_CC);
+ do_end_loop(second_semicolon_token->u.op.opline_num+1, 0 TSRMLS_CC);
DEC_BPC(CG(active_op_array));
}
@@ -855,22 +937,20 @@ void zend_do_pre_incdec(znode *result, const znode *op1, zend_uchar op TSRMLS_DC
if (last_op->opcode == ZEND_FETCH_OBJ_RW) {
last_op->opcode = (op==ZEND_PRE_INC)?ZEND_PRE_INC_OBJ:ZEND_PRE_DEC_OBJ;
- last_op->result.op_type = IS_VAR;
- last_op->result.u.EA.type = 0;
- last_op->result.u.var = get_temporary_variable(CG(active_op_array));
- *result = last_op->result;
+ last_op->result_type = IS_VAR;
+ last_op->result.var = get_temporary_variable(CG(active_op_array));
+ GET_NODE(result, last_op->result);
return;
}
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = op;
- opline->op1 = *op1;
+ SET_NODE(opline->op1, op1);
SET_UNUSED(opline->op2);
- opline->result.op_type = IS_VAR;
- opline->result.u.EA.type = 0;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- *result = opline->result;
+ opline->result_type = IS_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ GET_NODE(result, opline->result);
}
/* }}} */
@@ -879,25 +959,25 @@ void zend_do_post_incdec(znode *result, const znode *op1, zend_uchar op TSRMLS_D
int last_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline;
- if (last_op_number > 0) {
+ if (last_op_number > 0) {
zend_op *last_op = &CG(active_op_array)->opcodes[last_op_number-1];
if (last_op->opcode == ZEND_FETCH_OBJ_RW) {
last_op->opcode = (op==ZEND_POST_INC)?ZEND_POST_INC_OBJ:ZEND_POST_DEC_OBJ;
- last_op->result.op_type = IS_TMP_VAR;
- last_op->result.u.var = get_temporary_variable(CG(active_op_array));
- *result = last_op->result;
+ last_op->result_type = IS_TMP_VAR;
+ last_op->result.var = get_temporary_variable(CG(active_op_array));
+ GET_NODE(result, last_op->result);
return;
}
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = op;
- opline->op1 = *op1;
+ SET_NODE(opline->op1, op1);
SET_UNUSED(opline->op2);
- opline->result.op_type = IS_TMP_VAR;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- *result = opline->result;
+ opline->result_type = IS_TMP_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ GET_NODE(result, opline->result);
}
/* }}} */
@@ -907,8 +987,8 @@ void zend_do_if_cond(const znode *cond, znode *closing_bracket_token TSRMLS_DC)
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_JMPZ;
- opline->op1 = *cond;
- closing_bracket_token->u.opline_num = if_cond_op_number;
+ SET_NODE(opline->op1, cond);
+ closing_bracket_token->u.op.opline_num = if_cond_op_number;
SET_UNUSED(opline->op2);
INC_BPC(CG(active_op_array));
}
@@ -931,7 +1011,7 @@ void zend_do_if_after_statement(const znode *closing_bracket_token, unsigned cha
zend_stack_top(&CG(bp_stack), (void **) &jmp_list_ptr);
zend_llist_add_element(jmp_list_ptr, &if_end_op_number);
- CG(active_op_array)->opcodes[closing_bracket_token->u.opline_num].op2.u.opline_num = if_end_op_number+1;
+ CG(active_op_array)->opcodes[closing_bracket_token->u.op.opline_num].op2.opline_num = if_end_op_number+1;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
}
@@ -945,7 +1025,7 @@ void zend_do_if_end(TSRMLS_D) /* {{{ */
zend_stack_top(&CG(bp_stack), (void **) &jmp_list_ptr);
for (le=jmp_list_ptr->head; le; le = le->next) {
- CG(active_op_array)->opcodes[*((int *) le->data)].op1.u.opline_num = next_op_number;
+ CG(active_op_array)->opcodes[*((int *) le->data)].op1.opline_num = next_op_number;
}
zend_llist_destroy(jmp_list_ptr);
zend_stack_del_top(&CG(bp_stack));
@@ -955,7 +1035,7 @@ void zend_do_if_end(TSRMLS_D) /* {{{ */
void zend_check_writable_variable(const znode *variable) /* {{{ */
{
- zend_uint type = variable->u.EA.type;
+ zend_uint type = variable->EA;
if (type & ZEND_PARSED_METHOD_CALL) {
zend_error(E_COMPILE_ERROR, "Can't use method return value in write context");
@@ -996,17 +1076,18 @@ void zend_do_end_variable_parse(znode *variable, int type, int arg_offset TSRMLS
if (CG(active_op_array)->last == 0 ||
CG(active_op_array)->opcodes[CG(active_op_array)->last-1].opcode != ZEND_BEGIN_SILENCE) {
- this_var = opline_ptr->result.u.var;
+ this_var = opline_ptr->result.var;
if (CG(active_op_array)->this_var == -1) {
- CG(active_op_array)->this_var = lookup_cv(CG(active_op_array), Z_STRVAL(opline_ptr->op1.u.constant), Z_STRLEN(opline_ptr->op1.u.constant));
+ CG(active_op_array)->this_var = lookup_cv(CG(active_op_array), Z_STRVAL(CONSTANT(opline_ptr->op1.constant)), Z_STRLEN(CONSTANT(opline_ptr->op1.constant)));
+ Z_TYPE(CONSTANT(opline_ptr->op1.constant)) = IS_NULL;
} else {
- efree(Z_STRVAL(opline_ptr->op1.u.constant));
+ zend_del_literal(CG(active_op_array), opline_ptr->op1.constant);
}
le = le->next;
if (variable->op_type == IS_VAR &&
- variable->u.var == this_var) {
+ variable->u.op.var == this_var) {
variable->op_type = IS_CV;
- variable->u.var = CG(active_op_array)->this_var;
+ variable->u.op.var = CG(active_op_array)->this_var;
}
} else if (CG(active_op_array)->this_var == -1) {
CG(active_op_array)->this_var = lookup_cv(CG(active_op_array), estrndup("this", sizeof("this")-1), sizeof("this")-1);
@@ -1017,14 +1098,14 @@ void zend_do_end_variable_parse(znode *variable, int type, int arg_offset TSRMLS
opline_ptr = (zend_op *)le->data;
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
memcpy(opline, opline_ptr, sizeof(zend_op));
- if (opline->op1.op_type == IS_VAR &&
- opline->op1.u.var == this_var) {
- opline->op1.op_type = IS_CV;
- opline->op1.u.var = CG(active_op_array)->this_var;
+ if (opline->op1_type == IS_VAR &&
+ opline->op1.var == this_var) {
+ opline->op1_type = IS_CV;
+ opline->op1.var = CG(active_op_array)->this_var;
}
switch (type) {
case BP_VAR_R:
- if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2.op_type == IS_UNUSED) {
+ if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2_type == IS_UNUSED) {
zend_error(E_COMPILE_ERROR, "Cannot use [] for reading");
}
opline->opcode -= 3;
@@ -1035,17 +1116,17 @@ void zend_do_end_variable_parse(znode *variable, int type, int arg_offset TSRMLS
opline->opcode += 3;
break;
case BP_VAR_IS:
- if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2.op_type == IS_UNUSED) {
+ if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2_type == IS_UNUSED) {
zend_error(E_COMPILE_ERROR, "Cannot use [] for reading");
}
opline->opcode += 6; /* 3+3 */
break;
case BP_VAR_FUNC_ARG:
opline->opcode += 9; /* 3+3+3 */
- opline->extended_value = arg_offset;
+ opline->extended_value |= arg_offset;
break;
case BP_VAR_UNSET:
- if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2.op_type == IS_UNUSED) {
+ if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2_type == IS_UNUSED) {
zend_error(E_COMPILE_ERROR, "Cannot use [] for unsetting");
}
opline->opcode += 12; /* 3+3+3+3 */
@@ -1054,7 +1135,7 @@ void zend_do_end_variable_parse(znode *variable, int type, int arg_offset TSRMLS
le = le->next;
}
if (opline && type == BP_VAR_W && arg_offset) {
- opline->extended_value = ZEND_FETCH_MAKE_REF;
+ opline->extended_value |= ZEND_FETCH_MAKE_REF;
}
}
zend_llist_destroy(fetch_list_ptr);
@@ -1083,15 +1164,15 @@ void zend_do_add_string(znode *result, const znode *op1, znode *op2 TSRMLS_DC) /
}
if (op1) {
- opline->op1 = *op1;
- opline->result = *op1;
+ SET_NODE(opline->op1, op1);
+ SET_NODE(opline->result, op1);
} else {
SET_UNUSED(opline->op1);
- opline->result.op_type = IS_TMP_VAR;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
+ opline->result_type = IS_TMP_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
}
- opline->op2 = *op2;
- *result = opline->result;
+ SET_NODE(opline->op2, op2);
+ GET_NODE(result, opline->result);
}
/* }}} */
@@ -1102,15 +1183,15 @@ void zend_do_add_variable(znode *result, const znode *op1, const znode *op2 TSRM
opline->opcode = ZEND_ADD_VAR;
if (op1) {
- opline->op1 = *op1;
- opline->result = *op1;
+ SET_NODE(opline->op1, op1);
+ SET_NODE(opline->result, op1);
} else {
SET_UNUSED(opline->op1);
- opline->result.op_type = IS_TMP_VAR;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
+ opline->result_type = IS_TMP_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
}
- opline->op2 = *op2;
- *result = opline->result;
+ SET_NODE(opline->op2, op2);
+ GET_NODE(result, opline->result);
}
/* }}} */
@@ -1120,7 +1201,7 @@ void zend_do_free(znode *op1 TSRMLS_DC) /* {{{ */
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_FREE;
- opline->op1 = *op1;
+ SET_NODE(opline->op1, op1);
SET_UNUSED(opline->op2);
} else if (op1->op_type==IS_VAR) {
zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];
@@ -1128,23 +1209,23 @@ void zend_do_free(znode *op1 TSRMLS_DC) /* {{{ */
while (opline->opcode == ZEND_END_SILENCE || opline->opcode == ZEND_EXT_FCALL_END || opline->opcode == ZEND_OP_DATA) {
opline--;
}
- if (opline->result.op_type == IS_VAR
- && opline->result.u.var == op1->u.var) {
- opline->result.u.EA.type |= EXT_TYPE_UNUSED;
+ if (opline->result_type == IS_VAR
+ && opline->result.var == op1->u.op.var) {
+ opline->result_type |= EXT_TYPE_UNUSED;
} else {
while (opline>CG(active_op_array)->opcodes) {
if (opline->opcode == ZEND_FETCH_DIM_R
- && opline->op1.op_type == IS_VAR
- && opline->op1.u.var == op1->u.var) {
+ && opline->op1_type == IS_VAR
+ && opline->op1.var == op1->u.op.var) {
/* This should the end of a list() construct
* Mark its result as unused
*/
opline->extended_value = ZEND_FETCH_STANDARD;
break;
- } else if (opline->result.op_type==IS_VAR
- && opline->result.u.var == op1->u.var) {
+ } else if (opline->result_type==IS_VAR
+ && opline->result.var == op1->u.op.var) {
if (opline->opcode == ZEND_NEW) {
- opline->result.u.EA.type |= EXT_TYPE_UNUSED;
+ opline->result_type |= EXT_TYPE_UNUSED;
}
break;
}
@@ -1187,7 +1268,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
zend_op_array op_array;
char *name = function_name->u.constant.value.str.val;
int name_len = function_name->u.constant.value.str.len;
- int function_begin_line = function_token->u.opline_num;
+ int function_begin_line = function_token->u.op.opline_num;
zend_uint fn_flags;
char *lcname;
zend_bool orig_interactive;
@@ -1335,6 +1416,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
efree(lcname);
} else {
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ zval key;
if (CG(current_namespace)) {
/* Prefix function name with current namespcae name */
@@ -1350,15 +1432,15 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
}
opline->opcode = ZEND_DECLARE_FUNCTION;
- opline->op1.op_type = IS_CONST;
- build_runtime_defined_function_key(&opline->op1.u.constant, lcname, name_len TSRMLS_CC);
- opline->op2.op_type = IS_CONST;
- opline->op2.u.constant.type = IS_STRING;
- opline->op2.u.constant.value.str.val = lcname;
- opline->op2.u.constant.value.str.len = name_len;
- Z_SET_REFCOUNT(opline->op2.u.constant, 1);
+ opline->op1_type = IS_CONST;
+ build_runtime_defined_function_key(&key, lcname, name_len TSRMLS_CC);
+ opline->op1.constant = zend_add_literal(CG(active_op_array), &key);
+ Z_HASH_P(&CONSTANT(opline->op1.constant)) = zend_hash_func(Z_STRVAL(CONSTANT(opline->op1.constant)), Z_STRLEN(CONSTANT(opline->op1.constant)));
+ opline->op2_type = IS_CONST;
+ LITERAL_STRINGL(opline->op2, lcname, name_len, 0);
+ Z_HASH_P(&CONSTANT(opline->op2.constant)) = zend_hash_func(Z_STRVAL(CONSTANT(opline->op2.constant)), Z_STRLEN(CONSTANT(opline->op2.constant))+1);
opline->extended_value = ZEND_DECLARE_FUNCTION;
- zend_hash_update(CG(function_table), opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array));
+ zend_hash_quick_update(CG(function_table), Z_STRVAL(key), Z_STRLEN(key), Z_HASH_P(&CONSTANT(opline->op1.constant)), &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array));
}
if (CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO) {
@@ -1384,8 +1466,8 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
/* Foreach stack separator */
zend_op dummy_opline;
- dummy_opline.result.op_type = IS_UNUSED;
- dummy_opline.op1.op_type = IS_UNUSED;
+ dummy_opline.result_type = IS_UNUSED;
+ dummy_opline.op1_type = IS_UNUSED;
zend_stack_push(&CG(foreach_copy_stack), (void *) &dummy_opline, sizeof(zend_op));
}
@@ -1416,13 +1498,13 @@ void zend_do_begin_lambda_function_declaration(znode *result, znode *function_to
zend_do_begin_function_declaration(function_token, &function_name, 0, return_reference, NULL TSRMLS_CC);
result->op_type = IS_TMP_VAR;
- result->u.var = get_temporary_variable(current_op_array);
+ result->u.op.var = get_temporary_variable(current_op_array);
current_op = &current_op_array->opcodes[current_op_number];
current_op->opcode = ZEND_DECLARE_LAMBDA_FUNCTION;
- zval_dtor(&current_op->op2.u.constant);
- ZVAL_LONG(&current_op->op2.u.constant, zend_hash_func(Z_STRVAL(current_op->op1.u.constant), Z_STRLEN(current_op->op1.u.constant)));
- current_op->result = *result;
+ zend_del_literal(current_op_array, current_op->op2.constant);
+ SET_UNUSED(current_op->op2);
+ SET_NODE(current_op->result, result);
if (is_static) {
CG(active_op_array)->fn_flags |= ZEND_ACC_STATIC;
}
@@ -1489,7 +1571,7 @@ void zend_do_receive_arg(zend_uchar op, const znode *var, const znode *offset, c
}
if (var->op_type == IS_CV &&
- var->u.var == CG(active_op_array)->this_var &&
+ var->u.op.var == CG(active_op_array)->this_var &&
(CG(active_op_array)->fn_flags & ZEND_ACC_STATIC) == 0) {
zend_error(E_COMPILE_ERROR, "Cannot re-assign $this");
} else if (var->op_type == IS_VAR &&
@@ -1504,10 +1586,10 @@ void zend_do_receive_arg(zend_uchar op, const znode *var, const znode *offset, c
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
CG(active_op_array)->num_args++;
opline->opcode = op;
- opline->result = *var;
- opline->op1 = *offset;
+ SET_NODE(opline->result, var);
+ SET_NODE(opline->op1, offset);
if (op == ZEND_RECV_INIT) {
- opline->op2 = *initialization;
+ SET_NODE(opline->op2, initialization);
} else {
CG(active_op_array)->required_num_args = CG(active_op_array)->num_args;
SET_UNUSED(opline->op2);
@@ -1550,7 +1632,6 @@ void zend_do_receive_arg(zend_uchar op, const znode *var, const znode *offset, c
}
}
}
- opline->result.u.EA.type |= EXT_TYPE_UNUSED;
}
/* }}} */
@@ -1589,6 +1670,53 @@ int zend_do_begin_function_call(znode *function_name, zend_bool check_namespace
}
/* }}} */
+static void add_lowercased_name(int literal TSRMLS_DC) /* {{{ */
+{
+ /* Hack: the literal folowing to the name is the same lowercased name */
+ char *lc_name;
+ zval c;
+ int lc_literal;
+
+if (literal + 1 != CG(active_op_array)->last_literal) {
+zend_error(E_ERROR, "Internal error 1 ???");
+}
+ lc_name = zend_str_tolower_dup(Z_STRVAL(CONSTANT(literal)), Z_STRLEN(CONSTANT(literal)));
+ ZVAL_STRINGL(&c, lc_name, Z_STRLEN(CONSTANT(literal)), 0);
+ lc_literal = zend_add_literal(CG(active_op_array), &c);
+ Z_HASH_P(&CONSTANT(lc_literal)) = zend_hash_func(lc_name, Z_STRLEN(CONSTANT(literal))+1);
+if (literal + 1 != lc_literal) {
+zend_error(E_ERROR, "Internal error 2 ???");
+}
+}
+/* }}} */
+
+static void add_lowercased_class_name(int literal TSRMLS_DC) /* {{{ */
+{
+ /* Hack: the literal folowing to the name is the same lowercased name */
+ char *lc_name;
+ int lc_len;
+ zval c;
+ int lc_literal;
+
+if (literal + 1 != CG(active_op_array)->last_literal) {
+zend_error(E_ERROR, "Internal error 3 ???");
+}
+ if (Z_STRVAL(CONSTANT(literal))[0] == '\\') {
+ lc_len = Z_STRLEN(CONSTANT(literal)) - 1;
+ lc_name = zend_str_tolower_dup(Z_STRVAL(CONSTANT(literal)) + 1, lc_len);
+ } else {
+ lc_len = Z_STRLEN(CONSTANT(literal));
+ lc_name = zend_str_tolower_dup(Z_STRVAL(CONSTANT(literal)), lc_len);
+ }
+ ZVAL_STRINGL(&c, lc_name, lc_len, 0);
+ lc_literal = zend_add_literal(CG(active_op_array), &c);
+ Z_HASH_P(&CONSTANT(lc_literal)) = zend_hash_func(lc_name, lc_len+1);
+if (literal + 1 != lc_literal) {
+zend_error(E_ERROR, "Internal error 4 ???");
+}
+}
+/* }}} */
+
void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC) /* {{{ */
{
zend_op *last_op;
@@ -1601,27 +1729,27 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC) /* {{{ */
last_op_number = get_next_op_number(CG(active_op_array))-1;
last_op = &CG(active_op_array)->opcodes[last_op_number];
- if ((last_op->op2.op_type == IS_CONST) && (last_op->op2.u.constant.type == IS_STRING) && (last_op->op2.u.constant.value.str.len == sizeof(ZEND_CLONE_FUNC_NAME)-1)
- && !zend_binary_strcasecmp(last_op->op2.u.constant.value.str.val, last_op->op2.u.constant.value.str.len, ZEND_CLONE_FUNC_NAME, sizeof(ZEND_CLONE_FUNC_NAME)-1)) {
+ if ((last_op->op2_type == IS_CONST) && (Z_TYPE(CONSTANT(last_op->op2.constant)) == IS_STRING) && (Z_STRLEN(CONSTANT(last_op->op2.constant)) == sizeof(ZEND_CLONE_FUNC_NAME)-1)
+ && !zend_binary_strcasecmp(Z_STRVAL(CONSTANT(last_op->op2.constant)), Z_STRLEN(CONSTANT(last_op->op2.constant)), ZEND_CLONE_FUNC_NAME, sizeof(ZEND_CLONE_FUNC_NAME)-1)) {
zend_error(E_COMPILE_ERROR, "Cannot call __clone() method on objects - use 'clone $obj' instead");
}
if (last_op->opcode == ZEND_FETCH_OBJ_R) {
+ if (last_op->op2_type == IS_CONST) {
+ add_lowercased_name(last_op->op2.constant TSRMLS_CC);
+ }
last_op->opcode = ZEND_INIT_METHOD_CALL;
SET_UNUSED(last_op->result);
Z_LVAL(left_bracket->u.constant) = ZEND_INIT_FCALL_BY_NAME;
} else {
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_INIT_FCALL_BY_NAME;
- opline->op2 = *left_bracket;
- if (opline->op2.op_type == IS_CONST) {
- opline->op1.op_type = IS_CONST;
- Z_TYPE(opline->op1.u.constant) = IS_STRING;
- Z_STRVAL(opline->op1.u.constant) = zend_str_tolower_dup(Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant));
- Z_STRLEN(opline->op1.u.constant) = Z_STRLEN(opline->op2.u.constant);
- opline->extended_value = zend_hash_func(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant) + 1);
+ SET_NODE(opline->op2, left_bracket);
+ if (opline->op2_type == IS_CONST) {
+ opline->op1_type = IS_CONST;
+ LITERAL_STRINGL(opline->op1, zend_str_tolower_dup(Z_STRVAL(CONSTANT(opline->op2.constant)), Z_STRLEN(CONSTANT(opline->op2.constant))), Z_STRLEN(CONSTANT(opline->op2.constant)), 0);
+ Z_HASH_P(&CONSTANT(opline->op1.constant)) = zend_hash_func(Z_STRVAL(CONSTANT(opline->op1.constant)), Z_STRLEN(CONSTANT(opline->op1.constant))+1);
} else {
- opline->extended_value = 0;
SET_UNUSED(opline->op1);
}
}
@@ -1636,11 +1764,11 @@ void zend_do_clone(znode *result, const znode *expr TSRMLS_DC) /* {{{ */
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_CLONE;
- opline->op1 = *expr;
+ SET_NODE(opline->op1, expr);
SET_UNUSED(opline->op2);
- opline->result.op_type = IS_VAR;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- *result = opline->result;
+ opline->result_type = IS_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ GET_NODE(result, opline->result);
}
/* }}} */
@@ -1656,39 +1784,32 @@ void zend_do_begin_dynamic_function_call(znode *function_name, int ns_call TSRML
/* In run-time PHP will check for function with full name and
internal function with short name */
opline->opcode = ZEND_INIT_NS_FCALL_BY_NAME;
- opline->op2 = *function_name;
- opline->extended_value = 0;
- opline->op1.op_type = IS_CONST;
- Z_TYPE(opline->op1.u.constant) = IS_STRING;
- Z_STRVAL(opline->op1.u.constant) = zend_str_tolower_dup(Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant));
- Z_STRLEN(opline->op1.u.constant) = Z_STRLEN(opline->op2.u.constant);
- opline->extended_value = zend_hash_func(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant) + 1);
- slash = zend_memrchr(Z_STRVAL(opline->op1.u.constant), '\\', Z_STRLEN(opline->op1.u.constant));
- prefix_len = slash-Z_STRVAL(opline->op1.u.constant)+1;
- name_len = Z_STRLEN(opline->op1.u.constant)-prefix_len;
+ SET_NODE(opline->op2, function_name);
+ opline->op1_type = IS_CONST;
+ LITERAL_STRINGL(opline->op1, zend_str_tolower_dup(Z_STRVAL(CONSTANT(opline->op2.constant)), Z_STRLEN(CONSTANT(opline->op2.constant))), Z_STRLEN(CONSTANT(opline->op2.constant)), 0);
+ Z_HASH_P(&CONSTANT(opline->op1.constant)) = zend_hash_func(Z_STRVAL(CONSTANT(opline->op1.constant)), Z_STRLEN(CONSTANT(opline->op1.constant))+1);
+ slash = zend_memrchr(Z_STRVAL(CONSTANT(opline->op1.constant)), '\\', Z_STRLEN(CONSTANT(opline->op1.constant)));
+ prefix_len = slash-Z_STRVAL(CONSTANT(opline->op1.constant))+1;
+ name_len = Z_STRLEN(CONSTANT(opline->op1.constant))-prefix_len;
opline2 = get_next_op(CG(active_op_array) TSRMLS_CC);
opline2->opcode = ZEND_OP_DATA;
- opline2->op1.op_type = IS_CONST;
- Z_TYPE(opline2->op1.u.constant) = IS_LONG;
+ SET_UNUSED(opline2->op1);
if(!slash) {
- zend_error(E_CORE_ERROR, "Namespaced name %s should contain slash", Z_STRVAL(opline->op1.u.constant));
+ zend_error(E_CORE_ERROR, "Namespaced name %s should contain slash", Z_STRVAL(CONSTANT(opline->op1.constant)));
}
/* this is the length of namespace prefix */
- Z_LVAL(opline2->op1.u.constant) = prefix_len;
+ opline2->op1.num = prefix_len;
/* this is the hash of the non-prefixed part, lowercased */
opline2->extended_value = zend_hash_func(slash+1, name_len+1);
SET_UNUSED(opline2->op2);
} else {
opline->opcode = ZEND_INIT_FCALL_BY_NAME;
- opline->op2 = *function_name;
- if (opline->op2.op_type == IS_CONST) {
- opline->op1.op_type = IS_CONST;
- Z_TYPE(opline->op1.u.constant) = IS_STRING;
- Z_STRVAL(opline->op1.u.constant) = zend_str_tolower_dup(Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant));
- Z_STRLEN(opline->op1.u.constant) = Z_STRLEN(opline->op2.u.constant);
- opline->extended_value = zend_hash_func(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant) + 1);
+ SET_NODE(opline->op2, function_name);
+ if (opline->op2_type == IS_CONST) {
+ opline->op1_type = IS_CONST;
+ LITERAL_STRINGL(opline->op1, zend_str_tolower_dup(Z_STRVAL(CONSTANT(opline->op2.constant)), Z_STRLEN(CONSTANT(opline->op2.constant))), Z_STRLEN(CONSTANT(opline->op2.constant)), 0);
+ Z_HASH_P(&CONSTANT(opline->op1.constant)) = zend_hash_func(Z_STRVAL(CONSTANT(opline->op1.constant)), Z_STRLEN(CONSTANT(opline->op1.constant))+1);
} else {
- opline->extended_value = 0;
SET_UNUSED(opline->op1);
}
}
@@ -1858,16 +1979,17 @@ void zend_do_fetch_class(znode *result, znode *class_name TSRMLS_DC) /* {{{ */
break;
default:
zend_resolve_class_name(class_name, &opline->extended_value, 0 TSRMLS_CC);
- opline->op2 = *class_name;
+ SET_NODE(opline->op2, class_name);
+ add_lowercased_class_name(opline->op2.constant TSRMLS_CC);
break;
}
} else {
- opline->op2 = *class_name;
+ SET_NODE(opline->op2, class_name);
}
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- opline->result.u.EA.type = opline->extended_value;
- opline->result.op_type = IS_VAR; /* FIXME: Hack so that INIT_FCALL_BY_NAME still knows this is a class */
- *result = opline->result;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ opline->result_type = IS_VAR; /* FIXME: Hack so that INIT_FCALL_BY_NAME still knows this is a class */
+ GET_NODE(result, opline->result);
+ result->EA = opline->extended_value;
}
/* }}} */
@@ -1897,15 +2019,21 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2
{
zend_label *dest;
long current, distance;
+ zval *label;
+ if (pass2) {
+ label = opline->op2.zv;
+ } else {
+ label = &CONSTANT_EX(op_array, opline->op2.constant);
+ }
if (CG(labels) == NULL ||
- zend_hash_find(CG(labels), Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant)+1, (void**)&dest) == FAILURE) {
+ zend_hash_find(CG(labels), Z_STRVAL_P(label), Z_STRLEN_P(label)+1, (void**)&dest) == FAILURE) {
if (pass2) {
CG(in_compilation) = 1;
CG(active_op_array) = op_array;
CG(zend_lineno) = opline->lineno;
- zend_error(E_COMPILE_ERROR, "'goto' to undefined label '%s'", Z_STRVAL(opline->op2.u.constant));
+ zend_error(E_COMPILE_ERROR, "'goto' to undefined label '%s'", Z_STRVAL_P(label));
} else {
/* Label is not defined. Delay to pass 2. */
INC_BPC(op_array);
@@ -1913,8 +2041,9 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2
}
}
- opline->op1.u.opline_num = dest->opline_num;
- zval_dtor(&opline->op2.u.constant);
+ opline->op1.opline_num = dest->opline_num;
+ zval_dtor(label);
+ Z_TYPE_P(label) = IS_NULL;
/* Check that we are not moving into loop or switch */
current = opline->extended_value;
@@ -1937,7 +2066,7 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2
SET_UNUSED(opline->op2);
} else {
/* Set real break distance */
- ZVAL_LONG(&opline->op2.u.constant, distance);
+ ZVAL_LONG(label, distance);
}
if (pass2) {
@@ -1953,7 +2082,7 @@ void zend_do_goto(const znode *label TSRMLS_DC) /* {{{ */
opline->opcode = ZEND_GOTO;
opline->extended_value = CG(active_op_array)->current_brk_cont;
SET_UNUSED(opline->op1);
- opline->op2 = *label;
+ SET_NODE(opline->op2, label);
zend_resolve_goto_label(CG(active_op_array), opline, 0 TSRMLS_CC);
}
/* }}} */
@@ -2016,7 +2145,7 @@ int zend_do_begin_class_member_function_call(znode *class_name, znode *method_na
if ((sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) == Z_STRLEN(method_name->u.constant) &&
memcmp(lcname, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) == 0) {
zval_dtor(&method_name->u.constant);
- SET_UNUSED(*method_name);
+ method_name->op_type = IS_UNUSED;
}
efree(lcname);
}
@@ -2026,13 +2155,21 @@ int zend_do_begin_class_member_function_call(znode *class_name, znode *method_na
fetch_type = ZEND_FETCH_CLASS_GLOBAL;
zend_resolve_class_name(class_name, &fetch_type, 1 TSRMLS_CC);
class_node = *class_name;
+ opline = get_next_op(CG(active_op_array) TSRMLS_CC);
} else {
zend_do_fetch_class(&class_node, class_name TSRMLS_CC);
+ opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ opline->extended_value = class_node.EA ;
}
- opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_INIT_STATIC_METHOD_CALL;
- opline->op1 = class_node;
- opline->op2 = *method_name;
+ SET_NODE(opline->op1, &class_node);
+ if (opline->op1_type == IS_CONST) {
+ add_lowercased_class_name(opline->op1.constant TSRMLS_CC);
+ }
+ SET_NODE(opline->op2, method_name);
+ if (opline->op2_type == IS_CONST) {
+ add_lowercased_name(opline->op2.constant TSRMLS_CC);
+ }
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
zend_do_extended_fcall_begin(TSRMLS_C);
@@ -2054,17 +2191,17 @@ void zend_do_end_function_call(znode *function_name, znode *result, const znode
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
if (!is_method && !is_dynamic_fcall && function_name->op_type==IS_CONST) {
opline->opcode = ZEND_DO_FCALL;
- opline->op1 = *function_name;
- ZVAL_LONG(&opline->op2.u.constant, zend_hash_func(Z_STRVAL(function_name->u.constant), Z_STRLEN(function_name->u.constant) + 1));
+ SET_NODE(opline->op1, function_name);
+ Z_HASH_P(&CONSTANT(opline->op1.constant)) = zend_hash_func(Z_STRVAL(CONSTANT(opline->op1.constant)), Z_STRLEN(CONSTANT(opline->op1.constant))+1);
} else {
opline->opcode = ZEND_DO_FCALL_BY_NAME;
SET_UNUSED(opline->op1);
}
}
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- opline->result.op_type = IS_VAR;
- *result = opline->result;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ opline->result_type = IS_VAR;
+ GET_NODE(result, opline->result) ;
SET_UNUSED(opline->op2);
zend_stack_del_top(&CG(function_call_stack));
@@ -2173,8 +2310,8 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) /* {{
}
}
opline->opcode = op;
- opline->op1 = *param;
- opline->op2.u.opline_num = offset;
+ SET_NODE(opline->op1, param);
+ opline->op2.opline_num = offset;
SET_UNUSED(opline->op2);
}
/* }}} */
@@ -2190,7 +2327,7 @@ static int generate_free_switch_expr(const zend_switch_entry *switch_entry TSRML
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = (switch_entry->cond.op_type == IS_TMP_VAR) ? ZEND_FREE : ZEND_SWITCH_FREE;
- opline->op1 = switch_entry->cond;
+ SET_NODE(opline->op1, &switch_entry->cond);
SET_UNUSED(opline->op2);
opline->extended_value = 0;
return 0;
@@ -2202,22 +2339,22 @@ static int generate_free_foreach_copy(const zend_op *foreach_copy TSRMLS_DC) /*
zend_op *opline;
/* If we reach the seperator then stop applying the stack */
- if (foreach_copy->result.op_type == IS_UNUSED && foreach_copy->op1.op_type == IS_UNUSED) {
+ if (foreach_copy->result_type == IS_UNUSED && foreach_copy->op1_type == IS_UNUSED) {
return 1;
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
- opline->opcode = (foreach_copy->result.op_type == IS_TMP_VAR) ? ZEND_FREE : ZEND_SWITCH_FREE;
- opline->op1 = foreach_copy->result;
+ opline->opcode = (foreach_copy->result_type == IS_TMP_VAR) ? ZEND_FREE : ZEND_SWITCH_FREE;
+ COPY_NODE(opline->op1, foreach_copy->result);
SET_UNUSED(opline->op2);
opline->extended_value = 1;
- if (foreach_copy->op1.op_type != IS_UNUSED) {
+ if (foreach_copy->op1_type != IS_UNUSED) {
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
- opline->opcode = (foreach_copy->op1.op_type == IS_TMP_VAR) ? ZEND_FREE : ZEND_SWITCH_FREE;
- opline->op1 = foreach_copy->op1;
+ opline->opcode = (foreach_copy->op1_type == IS_TMP_VAR) ? ZEND_FREE : ZEND_SWITCH_FREE;
+ COPY_NODE(opline->op1, foreach_copy->op1);
SET_UNUSED(opline->op2);
opline->extended_value = 0;
}
@@ -2251,7 +2388,7 @@ void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC) /* {{{ */
end_op_number = get_next_op_number(CG(active_op_array));
while (start_op_number < end_op_number) {
- CG(active_op_array)->opcodes[start_op_number].op1.u.EA.type = EXT_TYPE_FREE_ON_RETURN;
+ CG(active_op_array)->opcodes[start_op_number].extended_value |= EXT_TYPE_FREE_ON_RETURN;
start_op_number++;
}
@@ -2260,14 +2397,14 @@ void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC) /* {{{ */
opline->opcode = ZEND_RETURN;
if (expr) {
- opline->op1 = *expr;
+ SET_NODE(opline->op1, expr);
if (do_end_vparse && zend_is_function_or_method_call(expr)) {
opline->extended_value = ZEND_RETURNS_FUNCTION;
}
} else {
- opline->op1.op_type = IS_CONST;
- INIT_ZVAL(opline->op1.u.constant);
+ opline->op1_type = IS_CONST;
+ LITERAL_NULL(opline->op1);
}
SET_UNUSED(opline->op2);
@@ -2292,7 +2429,7 @@ static void zend_add_catch_element(int offset, zend_uint catch_op TSRMLS_DC) /*
void zend_do_first_catch(znode *open_parentheses TSRMLS_DC) /* {{{ */
{
- open_parentheses->u.opline_num = get_next_op_number(CG(active_op_array));
+ open_parentheses->u.op.opline_num = get_next_op_number(CG(active_op_array));
}
/* }}} */
@@ -2313,7 +2450,7 @@ void zend_initialize_try_catch_element(const znode *try_token TSRMLS_DC) /* {{{
zend_stack_top(&CG(bp_stack), (void **) &jmp_list_ptr);
zend_llist_add_element(jmp_list_ptr, &jmp_op_number);
- zend_add_catch_element(try_token->u.opline_num, get_next_op_number(CG(active_op_array)) TSRMLS_CC);
+ zend_add_catch_element(try_token->u.op.opline_num, get_next_op_number(CG(active_op_array)) TSRMLS_CC);
}
/* }}} */
@@ -2321,12 +2458,12 @@ void zend_do_mark_last_catch(const znode *first_catch, const znode *last_additio
{
CG(active_op_array)->last--;
zend_do_if_end(TSRMLS_C);
- if (last_additional_catch->u.opline_num == -1) {
- CG(active_op_array)->opcodes[first_catch->u.opline_num].op1.u.EA.type = 1;
- CG(active_op_array)->opcodes[first_catch->u.opline_num].extended_value = get_next_op_number(CG(active_op_array));
+ if (last_additional_catch->u.op.opline_num == -1) {
+ CG(active_op_array)->opcodes[first_catch->u.op.opline_num].result.num = 1;
+ CG(active_op_array)->opcodes[first_catch->u.op.opline_num].extended_value = get_next_op_number(CG(active_op_array));
} else {
- CG(active_op_array)->opcodes[last_additional_catch->u.opline_num].op1.u.EA.type = 1;
- CG(active_op_array)->opcodes[last_additional_catch->u.opline_num].extended_value = get_next_op_number(CG(active_op_array));
+ CG(active_op_array)->opcodes[last_additional_catch->u.op.opline_num].result.num = 1;
+ CG(active_op_array)->opcodes[last_additional_catch->u.op.opline_num].extended_value = get_next_op_number(CG(active_op_array));
}
DEC_BPC(CG(active_op_array));
}
@@ -2334,7 +2471,7 @@ void zend_do_mark_last_catch(const znode *first_catch, const znode *last_additio
void zend_do_try(znode *try_token TSRMLS_DC) /* {{{ */
{
- try_token->u.opline_num = zend_add_try_element(get_next_op_number(CG(active_op_array)) TSRMLS_CC);
+ try_token->u.op.opline_num = zend_add_try_element(get_next_op_number(CG(active_op_array)) TSRMLS_CC);
INC_BPC(CG(active_op_array));
}
/* }}} */
@@ -2356,19 +2493,17 @@ void zend_do_begin_catch(znode *try_token, znode *class_name, const znode *catch
}
if (first_catch) {
- first_catch->u.opline_num = catch_op_number;
+ first_catch->u.op.opline_num = catch_op_number;
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_CATCH;
- opline->op1 = catch_class;
-/* SET_UNUSED(opline->op1); */ /* FIXME: Define IS_CLASS or something like that */
- opline->op2.op_type = IS_CV;
- opline->op2.u.var = lookup_cv(CG(active_op_array), catch_var->u.constant.value.str.val, catch_var->u.constant.value.str.len);
- opline->op2.u.EA.type = 0;
- opline->op1.u.EA.type = 0; /* 1 means it's the last catch in the block */
+ SET_NODE(opline->op1, &catch_class);
+ opline->op2_type = IS_CV;
+ opline->op2.var = lookup_cv(CG(active_op_array), catch_var->u.constant.value.str.val, catch_var->u.constant.value.str.len);
+ opline->result.num = 0; /* 1 means it's the last catch in the block */
- try_token->u.opline_num = catch_op_number;
+ try_token->u.op.opline_num = catch_op_number;
}
/* }}} */
@@ -2386,7 +2521,7 @@ void zend_do_end_catch(const znode *try_token TSRMLS_DC) /* {{{ */
zend_stack_top(&CG(bp_stack), (void **) &jmp_list_ptr);
zend_llist_add_element(jmp_list_ptr, &jmp_op_number);
- CG(active_op_array)->opcodes[try_token->u.opline_num].extended_value = get_next_op_number(CG(active_op_array));
+ CG(active_op_array)->opcodes[try_token->u.op.opline_num].extended_value = get_next_op_number(CG(active_op_array));
}
/* }}} */
@@ -2396,7 +2531,7 @@ void zend_do_throw(const znode *expr TSRMLS_DC) /* {{{ */
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_THROW;
- opline->op1 = *expr;
+ SET_NODE(opline->op1, expr);
SET_UNUSED(opline->op2);
}
/* }}} */
@@ -2929,16 +3064,25 @@ ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry
}
/* }}} */
-ZEND_API int do_bind_function(zend_op *opline, HashTable *function_table, zend_bool compile_time) /* {{{ */
+ZEND_API int do_bind_function(const zend_op_array *op_array, zend_op *opline, HashTable *function_table, zend_bool compile_time) /* {{{ */
{
zend_function *function;
+ zval *op1, *op2;
+
+ if (compile_time) {
+ op1 = &CONSTANT_EX(op_array, opline->op1.constant);
+ op2 = &CONSTANT_EX(op_array, opline->op2.constant);
+ } else {
+ op1 = opline->op1.zv;
+ op2 = opline->op2.zv;
+ }
- zend_hash_find(function_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void *) &function);
- if (zend_hash_add(function_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, function, sizeof(zend_function), NULL)==FAILURE) {
+ zend_hash_quick_find(function_table, Z_STRVAL_P(op1), Z_STRLEN_P(op1), Z_HASH_P(op1), (void *) &function);
+ if (zend_hash_quick_add(function_table, Z_STRVAL_P(op2), Z_STRLEN_P(op2)+1, Z_HASH_P(op2), function, sizeof(zend_function), NULL)==FAILURE) {
int error_level = compile_time ? E_COMPILE_ERROR : E_ERROR;
zend_function *old_function;
- if (zend_hash_find(function_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, (void *) &old_function)==SUCCESS
+ if (zend_hash_quick_find(function_table, Z_STRVAL_P(op2), Z_STRLEN_P(op2)+1, Z_HASH_P(op2), (void *) &old_function)==SUCCESS
&& old_function->type == ZEND_USER_FUNCTION
&& old_function->op_array.last > 0) {
zend_error(error_level, "Cannot redeclare %s() (previously declared in %s:%d)",
@@ -2957,18 +3101,26 @@ ZEND_API int do_bind_function(zend_op *opline, HashTable *function_table, zend_b
}
/* }}} */
-ZEND_API zend_class_entry *do_bind_class(const zend_op *opline, HashTable *class_table, zend_bool compile_time TSRMLS_DC) /* {{{ */
+ZEND_API zend_class_entry *do_bind_class(const zend_op_array* op_array, const zend_op *opline, HashTable *class_table, zend_bool compile_time TSRMLS_DC) /* {{{ */
{
zend_class_entry *ce, **pce;
+ zval *op1, *op2;
- if (zend_hash_find(class_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void **) &pce)==FAILURE) {
- zend_error(E_COMPILE_ERROR, "Internal Zend error - Missing class information for %s", opline->op1.u.constant.value.str.val);
+ if (compile_time) {
+ op1 = &CONSTANT_EX(op_array, opline->op1.constant);
+ op2 = &CONSTANT_EX(op_array, opline->op2.constant);
+ } else {
+ op1 = opline->op1.zv;
+ op2 = opline->op2.zv;
+ }
+ if (zend_hash_quick_find(class_table, Z_STRVAL_P(op1), Z_STRLEN_P(op1), Z_HASH_P(op1), (void **) &pce)==FAILURE) {
+ zend_error(E_COMPILE_ERROR, "Internal Zend error - Missing class information for %s", Z_STRVAL_P(op1));
return NULL;
} else {
ce = *pce;
}
ce->refcount++;
- if (zend_hash_add(class_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, &ce, sizeof(zend_class_entry *), NULL)==FAILURE) {
+ if (zend_hash_quick_add(class_table, Z_STRVAL_P(op2), Z_STRLEN_P(op2)+1, Z_HASH_P(op2), &ce, sizeof(zend_class_entry *), NULL)==FAILURE) {
ce->refcount--;
if (!compile_time) {
/* If we're in compile time, in practice, it's quite possible
@@ -2988,12 +3140,21 @@ ZEND_API zend_class_entry *do_bind_class(const zend_op *opline, HashTable *class
}
/* }}} */
-ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op *opline, HashTable *class_table, zend_class_entry *parent_ce, zend_bool compile_time TSRMLS_DC) /* {{{ */
+ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op_array *op_array, const zend_op *opline, HashTable *class_table, zend_class_entry *parent_ce, zend_bool compile_time TSRMLS_DC) /* {{{ */
{
zend_class_entry *ce, **pce;
int found_ce;
+ zval *op1, *op2;
+
+ if (compile_time) {
+ op1 = &CONSTANT_EX(op_array, opline->op1.constant);
+ op2 = &CONSTANT_EX(op_array, opline->op2.constant);
+ } else {
+ op1 = opline->op1.zv;
+ op2 = opline->op2.zv;
+ }
- found_ce = zend_hash_find(class_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void **) &pce);
+ found_ce = zend_hash_quick_find(class_table, Z_STRVAL_P(op1), Z_STRLEN_P(op1), Z_HASH_P(op1), (void **) &pce);
if (found_ce == FAILURE) {
if (!compile_time) {
@@ -3002,7 +3163,7 @@ ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op *opline, HashTa
* so we shut up about it. This allows the if (!defined('FOO')) { return; }
* approach to work.
*/
- zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", opline->op2.u.constant.value.str.val);
+ zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", Z_STRVAL_P(op2));
}
return NULL;
} else {
@@ -3018,7 +3179,7 @@ ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op *opline, HashTa
ce->refcount++;
/* Register the derived class */
- if (zend_hash_add(class_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, pce, sizeof(zend_class_entry *), NULL)==FAILURE) {
+ if (zend_hash_quick_add(class_table, Z_STRVAL_P(op2), Z_STRLEN_P(op2)+1, Z_HASH_P(op2), pce, sizeof(zend_class_entry *), NULL)==FAILURE) {
zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", ce->name);
}
return ce;
@@ -3036,13 +3197,13 @@ void zend_do_early_binding(TSRMLS_D) /* {{{ */
switch (opline->opcode) {
case ZEND_DECLARE_FUNCTION:
- if (do_bind_function(opline, CG(function_table), 1) == FAILURE) {
+ if (do_bind_function(CG(active_op_array), opline, CG(function_table), 1) == FAILURE) {
return;
}
table = CG(function_table);
break;
case ZEND_DECLARE_CLASS:
- if (do_bind_class(opline, CG(class_table), 1 TSRMLS_CC) == NULL) {
+ if (do_bind_class(CG(active_op_array), opline, CG(class_table), 1 TSRMLS_CC) == NULL) {
return;
}
table = CG(class_table);
@@ -3050,9 +3211,10 @@ void zend_do_early_binding(TSRMLS_D) /* {{{ */
case ZEND_DECLARE_INHERITED_CLASS:
{
zend_op *fetch_class_opline = opline-1;
- zval *parent_name = &fetch_class_opline->op2.u.constant;
+ zval *parent_name;
zend_class_entry **pce;
+ parent_name = &CONSTANT(fetch_class_opline->op2.constant);
if ((zend_lookup_class(Z_STRVAL_P(parent_name), Z_STRLEN_P(parent_name), &pce TSRMLS_CC) == FAILURE) ||
((CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_CLASSES) &&
((*pce)->type == ZEND_INTERNAL_CLASS))) {
@@ -3060,20 +3222,20 @@ void zend_do_early_binding(TSRMLS_D) /* {{{ */
zend_uint *opline_num = &CG(active_op_array)->early_binding;
while (*opline_num != -1) {
- opline_num = &CG(active_op_array)->opcodes[*opline_num].result.u.opline_num;
+ opline_num = &CG(active_op_array)->opcodes[*opline_num].result.opline_num;
}
*opline_num = opline - CG(active_op_array)->opcodes;
opline->opcode = ZEND_DECLARE_INHERITED_CLASS_DELAYED;
- opline->result.op_type = IS_UNUSED;
- opline->result.u.opline_num = -1;
+ opline->result_type = IS_UNUSED;
+ opline->result.opline_num = -1;
}
return;
}
- if (do_bind_inherited_class(opline, CG(class_table), *pce, 1 TSRMLS_CC) == NULL) {
+ if (do_bind_inherited_class(CG(active_op_array), opline, CG(class_table), *pce, 1 TSRMLS_CC) == NULL) {
return;
}
/* clear unnecessary ZEND_FETCH_CLASS opcode */
- zval_dtor(&fetch_class_opline->op2.u.constant);
+ zend_del_literal(CG(active_op_array), fetch_class_opline->op2.constant);
MAKE_NOP(fetch_class_opline);
table = CG(class_table);
@@ -3088,9 +3250,9 @@ void zend_do_early_binding(TSRMLS_D) /* {{{ */
return;
}
- zend_hash_del(table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len);
- zval_dtor(&opline->op1.u.constant);
- zval_dtor(&opline->op2.u.constant);
+ zend_hash_quick_del(table, Z_STRVAL(CONSTANT(opline->op1.constant)), Z_STRLEN(CONSTANT(opline->op1.constant)), Z_HASH_P(&CONSTANT(opline->op1.constant)));
+ zend_del_literal(CG(active_op_array), opline->op1.constant);
+ zend_del_literal(CG(active_op_array), opline->op2.constant);
MAKE_NOP(opline);
}
/* }}} */
@@ -3104,10 +3266,10 @@ ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array TSRMLS
CG(in_compilation) = 1;
while (opline_num != -1) {
- if (zend_lookup_class(Z_STRVAL(op_array->opcodes[opline_num-1].op2.u.constant), Z_STRLEN(op_array->opcodes[opline_num-1].op2.u.constant), &pce TSRMLS_CC) == SUCCESS) {
- do_bind_inherited_class(&op_array->opcodes[opline_num], EG(class_table), *pce, 1 TSRMLS_CC);
+ if (zend_lookup_class(Z_STRVAL_P(op_array->opcodes[opline_num-1].op2.zv), Z_STRLEN_P(op_array->opcodes[opline_num-1].op2.zv), &pce TSRMLS_CC) == SUCCESS) {
+ do_bind_inherited_class(op_array, &op_array->opcodes[opline_num], EG(class_table), *pce, 0 TSRMLS_CC);
}
- opline_num = op_array->opcodes[opline_num].result.u.opline_num;
+ opline_num = op_array->opcodes[opline_num].result.opline_num;
}
CG(in_compilation) = orig_in_compilation;
}
@@ -3121,17 +3283,17 @@ void zend_do_boolean_or_begin(znode *expr1, znode *op_token TSRMLS_DC) /* {{{ */
opline->opcode = ZEND_JMPNZ_EX;
if (expr1->op_type == IS_TMP_VAR) {
- opline->result = *expr1;
+ SET_NODE(opline->result, expr1);
} else {
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- opline->result.op_type = IS_TMP_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ opline->result_type = IS_TMP_VAR;
}
- opline->op1 = *expr1;
+ SET_NODE(opline->op1, expr1);
SET_UNUSED(opline->op2);
- op_token->u.opline_num = next_op_number;
+ op_token->u.op.opline_num = next_op_number;
- *expr1 = opline->result;
+ GET_NODE(expr1, opline->result);
}
/* }}} */
@@ -3141,11 +3303,11 @@ void zend_do_boolean_or_end(znode *result, const znode *expr1, const znode *expr
*result = *expr1; /* we saved the original result in expr1 */
opline->opcode = ZEND_BOOL;
- opline->result = *result;
- opline->op1 = *expr2;
+ SET_NODE(opline->result, result);
+ SET_NODE(opline->op1, expr2);
SET_UNUSED(opline->op2);
- CG(active_op_array)->opcodes[op_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array));
+ CG(active_op_array)->opcodes[op_token->u.op.opline_num].op2.opline_num = get_next_op_number(CG(active_op_array));
}
/* }}} */
@@ -3156,17 +3318,17 @@ void zend_do_boolean_and_begin(znode *expr1, znode *op_token TSRMLS_DC) /* {{{ *
opline->opcode = ZEND_JMPZ_EX;
if (expr1->op_type == IS_TMP_VAR) {
- opline->result = *expr1;
+ SET_NODE(opline->result, expr1);
} else {
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- opline->result.op_type = IS_TMP_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ opline->result_type = IS_TMP_VAR;
}
- opline->op1 = *expr1;
+ SET_NODE(opline->op1, expr1);
SET_UNUSED(opline->op2);
- op_token->u.opline_num = next_op_number;
+ op_token->u.op.opline_num = next_op_number;
- *expr1 = opline->result;
+ GET_NODE(expr1, opline->result);
}
/* }}} */
@@ -3176,11 +3338,11 @@ void zend_do_boolean_and_end(znode *result, const znode *expr1, const znode *exp
*result = *expr1; /* we saved the original result in expr1 */
opline->opcode = ZEND_BOOL;
- opline->result = *result;
- opline->op1 = *expr2;
+ SET_NODE(opline->result, result);
+ SET_NODE(opline->op1, expr2);
SET_UNUSED(opline->op2);
- CG(active_op_array)->opcodes[op_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array));
+ CG(active_op_array)->opcodes[op_token->u.op.opline_num].op2.opline_num = get_next_op_number(CG(active_op_array));
}
/* }}} */
@@ -3196,11 +3358,11 @@ void zend_do_do_while_end(const znode *do_token, const znode *expr_open_bracket,
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_JMPNZ;
- opline->op1 = *expr;
- opline->op2.u.opline_num = do_token->u.opline_num;
+ SET_NODE(opline->op1, expr);
+ opline->op2.opline_num = do_token->u.op.opline_num;
SET_UNUSED(opline->op2);
- do_end_loop(expr_open_bracket->u.opline_num, 0 TSRMLS_CC);
+ do_end_loop(expr_open_bracket->u.op.opline_num, 0 TSRMLS_CC);
DEC_BPC(CG(active_op_array));
}
@@ -3211,15 +3373,13 @@ void zend_do_brk_cont(zend_uchar op, const znode *expr TSRMLS_DC) /* {{{ */
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = op;
- opline->op1.u.opline_num = CG(active_op_array)->current_brk_cont;
+ opline->op1.opline_num = CG(active_op_array)->current_brk_cont;
SET_UNUSED(opline->op1);
if (expr) {
- opline->op2 = *expr;
+ SET_NODE(opline->op2, expr);
} else {
- Z_TYPE(opline->op2.u.constant) = IS_LONG;
- Z_LVAL(opline->op2.u.constant) = 1;
- INIT_PZVAL(&opline->op2.u.constant);
- opline->op2.op_type = IS_CONST;
+ LITERAL_LONG(opline->op2, 1);
+ opline->op2_type = IS_CONST;
}
}
/* }}} */
@@ -3252,13 +3412,13 @@ void zend_do_switch_end(const znode *case_list TSRMLS_DC) /* {{{ */
opline->opcode = ZEND_JMP;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
- opline->op1.u.opline_num = switch_entry_ptr->default_case;
+ opline->op1.opline_num = switch_entry_ptr->default_case;
}
if (case_list->op_type != IS_UNUSED) { /* non-empty switch */
int next_op_number = get_next_op_number(CG(active_op_array));
-
- CG(active_op_array)->opcodes[case_list->u.opline_num].op1.u.opline_num = next_op_number;
+
+ CG(active_op_array)->opcodes[case_list->u.op.opline_num].op1.opline_num = next_op_number;
}
/* remember break/continue loop information */
@@ -3269,7 +3429,7 @@ void zend_do_switch_end(const znode *case_list TSRMLS_DC) /* {{{ */
/* emit free for the switch condition*/
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = (switch_entry_ptr->cond.op_type == IS_TMP_VAR) ? ZEND_FREE : ZEND_SWITCH_FREE;
- opline->op1 = switch_entry_ptr->cond;
+ SET_NODE(opline->op1, &switch_entry_ptr->cond);
SET_UNUSED(opline->op2);
}
if (switch_entry_ptr->cond.op_type == IS_CONST) {
@@ -3295,27 +3455,27 @@ void zend_do_case_before_statement(const znode *case_list, znode *case_token, co
switch_entry_ptr->control_var = get_temporary_variable(CG(active_op_array));
}
opline->opcode = ZEND_CASE;
- opline->result.u.var = switch_entry_ptr->control_var;
- opline->result.op_type = IS_TMP_VAR;
- opline->op1 = switch_entry_ptr->cond;
- opline->op2 = *case_expr;
- if (opline->op1.op_type == IS_CONST) {
- zval_copy_ctor(&opline->op1.u.constant);
+ opline->result.var = switch_entry_ptr->control_var;
+ opline->result_type = IS_TMP_VAR;
+ SET_NODE(opline->op1, &switch_entry_ptr->cond);
+ SET_NODE(opline->op2, case_expr);
+ if (opline->op1_type == IS_CONST) {
+ zval_copy_ctor(&CONSTANT(opline->op1.constant));
}
- result = opline->result;
+ GET_NODE(&result, opline->result);
next_op_number = get_next_op_number(CG(active_op_array));
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_JMPZ;
- opline->op1 = result;
+ SET_NODE(opline->op1, &result);
SET_UNUSED(opline->op2);
- case_token->u.opline_num = next_op_number;
+ case_token->u.op.opline_num = next_op_number;
if (case_list->op_type==IS_UNUSED) {
return;
}
next_op_number = get_next_op_number(CG(active_op_array));
- CG(active_op_array)->opcodes[case_list->u.opline_num].op1.u.opline_num = next_op_number;
+ CG(active_op_array)->opcodes[case_list->u.op.opline_num].op1.opline_num = next_op_number;
}
/* }}} */
@@ -3327,14 +3487,14 @@ void zend_do_case_after_statement(znode *result, const znode *case_token TSRMLS_
opline->opcode = ZEND_JMP;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
- result->u.opline_num = next_op_number;
+ result->u.op.opline_num = next_op_number;
- switch (CG(active_op_array)->opcodes[case_token->u.opline_num].opcode) {
+ switch (CG(active_op_array)->opcodes[case_token->u.op.opline_num].opcode) {
case ZEND_JMP:
- CG(active_op_array)->opcodes[case_token->u.opline_num].op1.u.opline_num = get_next_op_number(CG(active_op_array));
+ CG(active_op_array)->opcodes[case_token->u.op.opline_num].op1.opline_num = get_next_op_number(CG(active_op_array));
break;
case ZEND_JMPZ:
- CG(active_op_array)->opcodes[case_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array));
+ CG(active_op_array)->opcodes[case_token->u.op.opline_num].op2.opline_num = get_next_op_number(CG(active_op_array));
break;
}
}
@@ -3351,7 +3511,7 @@ void zend_do_default_before_statement(const znode *case_list, znode *default_tok
opline->opcode = ZEND_JMP;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
- default_token->u.opline_num = next_op_number;
+ default_token->u.op.opline_num = next_op_number;
next_op_number = get_next_op_number(CG(active_op_array));
switch_entry_ptr->default_case = next_op_number;
@@ -3359,7 +3519,7 @@ void zend_do_default_before_statement(const znode *case_list, znode *default_tok
if (case_list->op_type==IS_UNUSED) {
return;
}
- CG(active_op_array)->opcodes[case_list->u.opline_num].op1.u.opline_num = next_op_number;
+ CG(active_op_array)->opcodes[case_list->u.op.opline_num].op1.opline_num = next_op_number;
}
/* }}} */
@@ -3370,7 +3530,7 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name
zend_class_entry *new_class_entry;
char *lcname;
int error = 0;
- zval **ns_name;
+ zval **ns_name, key;
if (CG(active_class_entry)) {
zend_error(E_COMPILE_ERROR, "Class declarations may not be nested");
@@ -3419,11 +3579,11 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name
zend_initialize_class_data(new_class_entry, 1 TSRMLS_CC);
new_class_entry->filename = zend_get_compiled_filename(TSRMLS_C);
- new_class_entry->line_start = class_token->u.opline_num;
- new_class_entry->ce_flags |= class_token->u.EA.type;
+ new_class_entry->line_start = class_token->u.op.opline_num;
+ new_class_entry->ce_flags |= class_token->EA;
if (parent_class_name && parent_class_name->op_type != IS_UNUSED) {
- switch (parent_class_name->u.EA.type) {
+ switch (parent_class_name->EA) {
case ZEND_FETCH_CLASS_SELF:
zend_error(E_COMPILE_ERROR, "Cannot use 'self' as class name as it is reserved");
break;
@@ -3440,29 +3600,29 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
- opline->op1.op_type = IS_CONST;
- build_runtime_defined_function_key(&opline->op1.u.constant, lcname, new_class_entry->name_length TSRMLS_CC);
+ opline->op1_type = IS_CONST;
+ build_runtime_defined_function_key(&key, lcname, new_class_entry->name_length TSRMLS_CC);
+ opline->op1.constant = zend_add_literal(CG(active_op_array), &key);
+ Z_HASH_P(&CONSTANT(opline->op1.constant)) = zend_hash_func(Z_STRVAL(CONSTANT(opline->op1.constant)), Z_STRLEN(CONSTANT(opline->op1.constant)));
- opline->op2.op_type = IS_CONST;
- opline->op2.u.constant.type = IS_STRING;
- Z_SET_REFCOUNT(opline->op2.u.constant, 1);
+ opline->op2_type = IS_CONST;
if (doing_inheritance) {
- opline->extended_value = parent_class_name->u.var;
+ opline->extended_value = parent_class_name->u.op.var;
opline->opcode = ZEND_DECLARE_INHERITED_CLASS;
} else {
opline->opcode = ZEND_DECLARE_CLASS;
}
- opline->op2.u.constant.value.str.val = lcname;
- opline->op2.u.constant.value.str.len = new_class_entry->name_length;
+ LITERAL_STRINGL(opline->op2, lcname, new_class_entry->name_length, 0);
+ Z_HASH_P(&CONSTANT(opline->op2.constant)) = zend_hash_func(Z_STRVAL(CONSTANT(opline->op2.constant)), Z_STRLEN(CONSTANT(opline->op2.constant))+1);
- zend_hash_update(CG(class_table), opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, &new_class_entry, sizeof(zend_class_entry *), NULL);
+ zend_hash_quick_update(CG(class_table), Z_STRVAL(key), Z_STRLEN(key), Z_HASH_P(&CONSTANT(opline->op1.constant)), &new_class_entry, sizeof(zend_class_entry *), NULL);
CG(active_class_entry) = new_class_entry;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- opline->result.op_type = IS_VAR;
- CG(implementing_class) = opline->result;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ opline->result_type = IS_VAR;
+ GET_NODE(&CG(implementing_class), opline->result);
if (CG(doc_comment)) {
CG(active_class_entry)->doc_comment = CG(doc_comment);
@@ -3478,7 +3638,7 @@ static void do_verify_abstract_class(TSRMLS_D) /* {{{ */
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_VERIFY_ABSTRACT_CLASS;
- opline->op1 = CG(implementing_class);
+ SET_NODE(opline->op1, &CG(implementing_class));
SET_UNUSED(opline->op2);
}
/* }}} */
@@ -3544,10 +3704,11 @@ void zend_do_implements_interface(znode *interface_name TSRMLS_DC) /* {{{ */
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_ADD_INTERFACE;
- opline->op1 = CG(implementing_class);
+ SET_NODE(opline->op1, &CG(implementing_class));
zend_resolve_class_name(interface_name, &opline->extended_value, 0 TSRMLS_CC);
opline->extended_value = (opline->extended_value & ~ZEND_FETCH_CLASS_MASK) | ZEND_FETCH_CLASS_INTERFACE;
- opline->op2 = *interface_name;
+ SET_NODE(opline->op2, interface_name);
+ add_lowercased_class_name(opline->op2.constant TSRMLS_CC);
CG(active_class_entry)->num_interfaces++;
}
/* }}} */
@@ -3683,17 +3844,17 @@ void zend_do_fetch_property(znode *result, znode *object, const znode *property
zend_stack_top(&CG(bp_stack), (void **) &fetch_list_ptr);
if (object->op_type == IS_CV) {
- if (object->u.var == CG(active_op_array)->this_var) {
- SET_UNUSED(*object); /* this means $this for objects */
+ if (object->u.op.var == CG(active_op_array)->this_var) {
+ object->op_type = IS_UNUSED; /* this means $this for objects */
}
} else if (fetch_list_ptr->count == 1) {
zend_llist_element *le = fetch_list_ptr->head;
zend_op *opline_ptr = (zend_op *) le->data;
if (opline_is_fetch_this(opline_ptr TSRMLS_CC)) {
- efree(Z_STRVAL(opline_ptr->op1.u.constant));
+ zend_del_literal(CG(active_op_array), opline_ptr->op1.constant);
SET_UNUSED(opline_ptr->op1); /* this means $this for objects */
- opline_ptr->op2 = *property;
+ SET_NODE(opline_ptr->op2, property);
/* if it was usual fetch, we change it to object fetch */
switch (opline_ptr->opcode) {
case ZEND_FETCH_W:
@@ -3715,19 +3876,24 @@ void zend_do_fetch_property(znode *result, znode *object, const znode *property
opline_ptr->opcode = ZEND_FETCH_OBJ_FUNC_ARG;
break;
}
- *result = opline_ptr->result;
+ if (opline_ptr->op2_type == IS_CONST && Z_TYPE(CONSTANT(opline_ptr->op2.constant)) == IS_STRING) {
+ Z_HASH_P(&CONSTANT(opline_ptr->op2.constant)) = zend_hash_func(Z_STRVAL(CONSTANT(opline_ptr->op2.constant)), Z_STRLEN(CONSTANT(opline_ptr->op2.constant))+1);
+ }
+ GET_NODE(result, opline_ptr->result);
return;
}
}
init_op(&opline TSRMLS_CC);
opline.opcode = ZEND_FETCH_OBJ_W; /* the backpatching routine assumes W */
- opline.result.op_type = IS_VAR;
- opline.result.u.EA.type = 0;
- opline.result.u.var = get_temporary_variable(CG(active_op_array));
- opline.op1 = *object;
- opline.op2 = *property;
- *result = opline.result;
+ opline.result_type = IS_VAR;
+ opline.result.var = get_temporary_variable(CG(active_op_array));
+ SET_NODE(opline.op1, object);
+ SET_NODE(opline.op2, property);
+ if (opline.op2_type == IS_CONST && Z_TYPE(CONSTANT(opline.op2.constant)) == IS_STRING) {
+ Z_HASH_P(&CONSTANT(opline.op2.constant)) = zend_hash_func(Z_STRVAL(CONSTANT(opline.op2.constant)), Z_STRLEN(CONSTANT(opline.op2.constant))+1);
+ }
+ GET_NODE(result, opline.result);
zend_llist_add_element(fetch_list_ptr, &opline);
}
@@ -3746,40 +3912,6 @@ void zend_do_halt_compiler_register(TSRMLS_D) /* {{{ */
}
/* }}} */
-void zend_do_declare_implicit_property(TSRMLS_D) /* {{{ */
-{
-/* Fixes bug #26182. Not sure why we needed to do this in the first place.
- Has to be checked with Zeev.
-*/
-#if ANDI_0
- zend_op *opline_ptr;
- zend_llist_element *le;
- zend_llist *fetch_list_ptr;
-
-
- zend_stack_top(&CG(bp_stack), (void **) &fetch_list_ptr);
-
- if (fetch_list_ptr->count != 1) {
- return;
- }
-
- le = fetch_list_ptr->head;
- opline_ptr = (zend_op *) le->data;
-
- if (opline_ptr->op1.op_type == IS_UNUSED
- && CG(active_class_entry)
- && opline_ptr->op2.op_type == IS_CONST
- && !zend_hash_exists(&CG(active_class_entry)->properties_info, opline_ptr->op2.u.constant.value.str.val, opline_ptr->op2.u.constant.value.str.len+1)) {
- znode property;
-
- property = opline_ptr->op2;
- property.u.constant.value.str.val = estrndup(opline_ptr->op2.u.constant.value.str.val, opline_ptr->op2.u.constant.value.str.len);
- zend_do_declare_property(&property, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_IMPLICIT_PUBLIC TSRMLS_CC);
- }
-#endif
-}
-/* }}} */
-
void zend_do_push_object(const znode *object TSRMLS_DC) /* {{{ */
{
zend_stack_push(&CG(object_stack), object, sizeof(znode));
@@ -3803,12 +3935,12 @@ void zend_do_begin_new_object(znode *new_token, znode *class_type TSRMLS_DC) /*
zend_op *opline;
unsigned char *ptr = NULL;
- new_token->u.opline_num = get_next_op_number(CG(active_op_array));
+ new_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_NEW;
- opline->result.op_type = IS_VAR;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- opline->op1 = *class_type;
+ opline->result_type = IS_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ SET_NODE(opline->op1, class_type);
SET_UNUSED(opline->op2);
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(unsigned char *));
@@ -3822,8 +3954,8 @@ void zend_do_end_new_object(znode *result, const znode *new_token, const znode *
zend_do_end_function_call(NULL, &ctor_result, argument_list, 1, 0 TSRMLS_CC);
zend_do_free(&ctor_result TSRMLS_CC);
- CG(active_op_array)->opcodes[new_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array));
- *result = CG(active_op_array)->opcodes[new_token->u.opline_num].result;
+ CG(active_op_array)->opcodes[new_token->u.op.opline_num].op2.opline_num = get_next_op_number(CG(active_op_array));
+ GET_NODE(result, CG(active_op_array)->opcodes[new_token->u.op.opline_num].result);
}
/* }}} */
@@ -3919,11 +4051,15 @@ void zend_do_fetch_constant(znode *result, znode *constant_container, znode *con
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_FETCH_CONSTANT;
- opline->result.op_type = IS_TMP_VAR;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- opline->op1 = *constant_container;
- opline->op2 = *constant_name;
- *result = opline->result;
+ opline->result_type = IS_TMP_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ SET_NODE(opline->op1, constant_container);
+ if (opline->op1_type == IS_CONST) {
+ add_lowercased_class_name(opline->op1.constant TSRMLS_CC);
+ }
+ SET_NODE(opline->op2, constant_name);
+ Z_HASH_P(&CONSTANT(opline->op2.constant)) = zend_hash_func(Z_STRVAL(CONSTANT(opline->op2.constant)), Z_STRLEN(CONSTANT(opline->op2.constant))+1);
+ GET_NODE(result, opline->result);
break;
}
return;
@@ -3959,9 +4095,9 @@ void zend_do_fetch_constant(znode *result, znode *constant_container, znode *con
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_FETCH_CONSTANT;
- opline->result.op_type = IS_TMP_VAR;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- *result = opline->result;
+ opline->result_type = IS_TMP_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ GET_NODE(result, opline->result);
SET_UNUSED(opline->op1);
if(compound) {
/* the name is unambiguous */
@@ -3969,7 +4105,8 @@ void zend_do_fetch_constant(znode *result, znode *constant_container, znode *con
} else {
opline->extended_value = IS_CONSTANT_UNQUALIFIED;
}
- opline->op2 = *constant_name;
+ SET_NODE(opline->op2, constant_name);
+ Z_HASH_P(&CONSTANT(opline->op2.constant)) = zend_hash_func(Z_STRVAL(CONSTANT(opline->op2.constant)), Z_STRLEN(CONSTANT(opline->op2.constant))+1);
break;
}
}
@@ -3988,25 +4125,22 @@ void zend_do_shell_exec(znode *result, const znode *cmd TSRMLS_DC) /* {{{ */
opline->opcode = ZEND_SEND_VAR;
break;
}
- opline->op1 = *cmd;
- opline->op2.u.opline_num = 0;
+ SET_NODE(opline->op1, cmd);
+ opline->op2.opline_num = 0;
opline->extended_value = ZEND_DO_FCALL;
SET_UNUSED(opline->op2);
/* FIXME: exception support not added to this op2 */
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_DO_FCALL;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- opline->result.op_type = IS_VAR;
- Z_STRVAL(opline->op1.u.constant) = estrndup("shell_exec", sizeof("shell_exec")-1);
- Z_STRLEN(opline->op1.u.constant) = sizeof("shell_exec")-1;
- INIT_PZVAL(&opline->op1.u.constant);
- Z_TYPE(opline->op1.u.constant) = IS_STRING;
- opline->op1.op_type = IS_CONST;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ opline->result_type = IS_VAR;
+ LITERAL_STRINGL(opline->op1, estrndup("shell_exec", sizeof("shell_exec")-1), sizeof("shell_exec")-1, 0);
+ Z_HASH_P(&CONSTANT(opline->op1.constant)) = zend_hash_func(Z_STRVAL(CONSTANT(opline->op1.constant)), Z_STRLEN(CONSTANT(opline->op1.constant))+1);
+ opline->op1_type = IS_CONST;
opline->extended_value = 1;
SET_UNUSED(opline->op2);
- ZVAL_LONG(&opline->op2.u.constant, zend_hash_func("shell_exec", sizeof("shell_exec")));
- *result = opline->result;
+ GET_NODE(result, opline->result);
}
/* }}} */
@@ -4015,13 +4149,25 @@ void zend_do_init_array(znode *result, const znode *expr, const znode *offset, z
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_INIT_ARRAY;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- opline->result.op_type = IS_TMP_VAR;
- *result = opline->result;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ opline->result_type = IS_TMP_VAR;
+ GET_NODE(result, opline->result);
if (expr) {
- opline->op1 = *expr;
+ SET_NODE(opline->op1, expr);
if (offset) {
- opline->op2 = *offset;
+ SET_NODE(opline->op2, offset);
+ if (opline->op2_type == IS_CONST && Z_TYPE(CONSTANT(opline->op2.constant)) == IS_STRING) {
+ long index;
+ int numeric = 0;
+
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL(CONSTANT(opline->op2.constant)), Z_STRLEN(CONSTANT(opline->op2.constant))+1, index, numeric = 1);
+ if (numeric) {
+ zval_dtor(&CONSTANT(opline->op2.constant));
+ ZVAL_LONG(&CONSTANT(opline->op2.constant), index);
+ } else {
+ Z_HASH_P(&CONSTANT(opline->op2.constant)) = zend_hash_func(Z_STRVAL(CONSTANT(opline->op2.constant)), Z_STRLEN(CONSTANT(opline->op2.constant))+1);
+ }
+ }
} else {
SET_UNUSED(opline->op2);
}
@@ -4038,10 +4184,22 @@ void zend_do_add_array_element(znode *result, const znode *expr, const znode *of
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_ADD_ARRAY_ELEMENT;
- opline->result = *result;
- opline->op1 = *expr;
+ SET_NODE(opline->result, result);
+ SET_NODE(opline->op1, expr);
if (offset) {
- opline->op2 = *offset;
+ SET_NODE(opline->op2, offset);
+ if (opline->op2_type == IS_CONST && Z_TYPE(CONSTANT(opline->op2.constant)) == IS_STRING) {
+ long index;
+ int numeric = 0;
+
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL(CONSTANT(opline->op2.constant)), Z_STRLEN(CONSTANT(opline->op2.constant))+1, index, numeric = 1);
+ if (numeric) {
+ zval_dtor(&CONSTANT(opline->op2.constant));
+ ZVAL_LONG(&CONSTANT(opline->op2.constant), index);
+ } else {
+ Z_HASH_P(&CONSTANT(opline->op2.constant)) = zend_hash_func(Z_STRVAL(CONSTANT(opline->op2.constant)), Z_STRLEN(CONSTANT(opline->op2.constant))+1);
+ }
+ }
} else {
SET_UNUSED(opline->op2);
}
@@ -4157,19 +4315,16 @@ void zend_do_list_end(znode *result, znode *expr TSRMLS_DC) /* {{{ */
opline->opcode = ZEND_FETCH_DIM_TMP_VAR;
break;
}
- opline->extended_value = ZEND_FETCH_ADD_LOCK;
+ opline->extended_value |= ZEND_FETCH_ADD_LOCK;
} else {
opline->opcode = ZEND_FETCH_DIM_R;
}
- opline->result.op_type = IS_VAR;
- opline->result.u.EA.type = 0;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- opline->op1 = last_container;
- opline->op2.op_type = IS_CONST;
- Z_TYPE(opline->op2.u.constant) = IS_LONG;
- Z_LVAL(opline->op2.u.constant) = *((int *) dimension->data);
- INIT_PZVAL(&opline->op2.u.constant);
- last_container = opline->result;
+ opline->result_type = IS_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ SET_NODE(opline->op1, &last_container);
+ opline->op2_type = IS_CONST;
+ LITERAL_LONG(opline->op2, *((int *) dimension->data));
+ GET_NODE(&last_container, opline->result);
dimension = dimension->next;
}
((list_llist_element *) le->data)->value = last_container;
@@ -4223,13 +4378,15 @@ void zend_do_fetch_static_variable(znode *varname, const znode *static_assignmen
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = (fetch_type == ZEND_FETCH_LEXICAL) ? ZEND_FETCH_R : ZEND_FETCH_W; /* the default mode must be Write, since fetch_simple_variable() is used to define function arguments */
- opline->result.op_type = IS_VAR;
- opline->result.u.EA.type = 0;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- opline->op1 = *varname;
+ opline->result_type = IS_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ SET_NODE(opline->op1, varname);
+ if (opline->op1_type == IS_CONST) {
+ Z_HASH_P(&CONSTANT(opline->op1.constant)) = zend_hash_func(Z_STRVAL(CONSTANT(opline->op1.constant)), Z_STRLEN(CONSTANT(opline->op1.constant))+1);
+ }
SET_UNUSED(opline->op2);
- opline->op2.u.EA.type = ZEND_FETCH_STATIC;
- result = opline->result;
+ opline->extended_value = ZEND_FETCH_STATIC;
+ GET_NODE(&result, opline->result);
if (varname->op_type == IS_CONST) {
zval_copy_ctor(&varname->u.constant);
@@ -4245,9 +4402,7 @@ void zend_do_fetch_static_variable(znode *varname, const znode *static_assignmen
} else {
zend_do_assign_ref(NULL, &lval, &result TSRMLS_CC);
}
- CG(active_op_array)->opcodes[CG(active_op_array)->last-1].result.u.EA.type |= EXT_TYPE_UNUSED;
-
-/* zval_dtor(&varname->u.constant); */
+ CG(active_op_array)->opcodes[CG(active_op_array)->last-1].result_type |= EXT_TYPE_UNUSED;
}
/* }}} */
@@ -4285,13 +4440,15 @@ void zend_do_fetch_global_variable(znode *varname, const znode *static_assignmen
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_FETCH_W; /* the default mode must be Write, since fetch_simple_variable() is used to define function arguments */
- opline->result.op_type = IS_VAR;
- opline->result.u.EA.type = 0;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- opline->op1 = *varname;
+ opline->result_type = IS_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ SET_NODE(opline->op1, varname);
+ if (opline->op1_type == IS_CONST) {
+ Z_HASH_P(&CONSTANT(opline->op1.constant)) = zend_hash_func(Z_STRVAL(CONSTANT(opline->op1.constant)), Z_STRLEN(CONSTANT(opline->op1.constant))+1);
+ }
SET_UNUSED(opline->op2);
- opline->op2.u.EA.type = fetch_type;
- result = opline->result;
+ opline->extended_value = fetch_type;
+ GET_NODE(&result, opline->result);
if (varname->op_type == IS_CONST) {
zval_copy_ctor(&varname->u.constant);
@@ -4299,7 +4456,7 @@ void zend_do_fetch_global_variable(znode *varname, const znode *static_assignmen
fetch_simple_variable(&lval, varname, 0 TSRMLS_CC); /* Relies on the fact that the default fetch is BP_VAR_W */
zend_do_assign_ref(NULL, &lval, &result TSRMLS_CC);
- CG(active_op_array)->opcodes[CG(active_op_array)->last-1].result.u.EA.type |= EXT_TYPE_UNUSED;
+ CG(active_op_array)->opcodes[CG(active_op_array)->last-1].result_type |= EXT_TYPE_UNUSED;
}
/* }}} */
@@ -4308,12 +4465,12 @@ void zend_do_cast(znode *result, const znode *expr, int type TSRMLS_DC) /* {{{ *
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_CAST;
- opline->result.op_type = IS_TMP_VAR;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- opline->op1 = *expr;
+ opline->result_type = IS_TMP_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ SET_NODE(opline->op1, expr);
SET_UNUSED(opline->op2);
opline->extended_value = type;
- *result = opline->result;
+ GET_NODE(result, opline->result);
}
/* }}} */
@@ -4324,12 +4481,12 @@ void zend_do_include_or_eval(int type, znode *result, const znode *op1 TSRMLS_DC
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_INCLUDE_OR_EVAL;
- opline->result.op_type = IS_VAR;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- opline->op1 = *op1;
+ opline->result_type = IS_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ SET_NODE(opline->op1, op1);
SET_UNUSED(opline->op2);
- Z_LVAL(opline->op2.u.constant) = type;
- *result = opline->result;
+ opline->extended_value = type;
+ GET_NODE(result, opline->result);
}
zend_do_extended_fcall_end(TSRMLS_C);
}
@@ -4358,11 +4515,10 @@ void zend_do_unset(const znode *variable TSRMLS_DC) /* {{{ */
if (variable->op_type == IS_CV) {
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_UNSET_VAR;
- opline->op1 = *variable;
+ SET_NODE(opline->op1, variable);
SET_UNUSED(opline->op2);
- opline->op2.u.EA.type = ZEND_FETCH_LOCAL;
SET_UNUSED(opline->result);
- opline->extended_value = ZEND_QUICK_SET;
+ opline->extended_value = ZEND_FETCH_LOCAL | ZEND_QUICK_SET;
} else {
last_op = &CG(active_op_array)->opcodes[get_next_op_number(CG(active_op_array))-1];
@@ -4393,11 +4549,10 @@ void zend_do_isset_or_isempty(int type, znode *result, znode *variable TSRMLS_DC
if (variable->op_type == IS_CV) {
last_op = get_next_op(CG(active_op_array) TSRMLS_CC);
last_op->opcode = ZEND_ISSET_ISEMPTY_VAR;
- last_op->op1 = *variable;
+ SET_NODE(last_op->op1, variable);
SET_UNUSED(last_op->op2);
- last_op->op2.u.EA.type = ZEND_FETCH_LOCAL;
- last_op->result.u.var = get_temporary_variable(CG(active_op_array));
- last_op->extended_value = ZEND_QUICK_SET;
+ last_op->result.var = get_temporary_variable(CG(active_op_array));
+ last_op->extended_value = ZEND_FETCH_LOCAL | ZEND_QUICK_SET;
} else {
last_op = &CG(active_op_array)->opcodes[get_next_op_number(CG(active_op_array))-1];
@@ -4412,12 +4567,11 @@ void zend_do_isset_or_isempty(int type, znode *result, znode *variable TSRMLS_DC
last_op->opcode = ZEND_ISSET_ISEMPTY_PROP_OBJ;
break;
}
- last_op->extended_value = 0;
}
- last_op->result.op_type = IS_TMP_VAR;
+ last_op->result_type = IS_TMP_VAR;
last_op->extended_value |= type;
- *result = last_op->result;
+ GET_NODE(result, last_op->result);
}
/* }}} */
@@ -4439,13 +4593,13 @@ void zend_do_instanceof(znode *result, const znode *expr, const znode *class_zno
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_INSTANCEOF;
- opline->result.op_type = IS_TMP_VAR;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- opline->op1 = *expr;
+ opline->result_type = IS_TMP_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ SET_NODE(opline->op1, expr);
- opline->op2 = *class_znode;
+ SET_NODE(opline->op2, class_znode);
- *result = opline->result;
+ GET_NODE(result, opline->result);
}
/* }}} */
@@ -4463,53 +4617,50 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno
is_variable = 1;
}
/* save the location of FETCH_W instruction(s) */
- open_brackets_token->u.opline_num = get_next_op_number(CG(active_op_array));
+ open_brackets_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
zend_do_end_variable_parse(array, BP_VAR_W, 0 TSRMLS_CC);
if (CG(active_op_array)->last > 0 &&
CG(active_op_array)->opcodes[CG(active_op_array)->last-1].opcode == ZEND_FETCH_OBJ_W) {
/* Only lock the container if we are fetching from a real container and not $this */
- if (CG(active_op_array)->opcodes[CG(active_op_array)->last-1].op1.op_type == IS_VAR) {
+ if (CG(active_op_array)->opcodes[CG(active_op_array)->last-1].op1_type == IS_VAR) {
CG(active_op_array)->opcodes[CG(active_op_array)->last-1].extended_value |= ZEND_FETCH_ADD_LOCK;
push_container = 1;
}
}
} else {
is_variable = 0;
- open_brackets_token->u.opline_num = get_next_op_number(CG(active_op_array));
+ open_brackets_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
}
/* save the location of FE_RESET */
- foreach_token->u.opline_num = get_next_op_number(CG(active_op_array));
+ foreach_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
/* Preform array reset */
opline->opcode = ZEND_FE_RESET;
- opline->result.op_type = IS_VAR;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- opline->op1 = *array;
+ opline->result_type = IS_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ SET_NODE(opline->op1, array);
SET_UNUSED(opline->op2);
opline->extended_value = is_variable ? ZEND_FE_RESET_VARIABLE : 0;
- dummy_opline.result = opline->result;
+ COPY_NODE(dummy_opline.result, opline->result);
if (push_container) {
- dummy_opline.op1 = CG(active_op_array)->opcodes[CG(active_op_array)->last-2].op1;
+ COPY_NODE(dummy_opline.op1, CG(active_op_array)->opcodes[CG(active_op_array)->last-2].op1);
} else {
- znode tmp;
-
- tmp.op_type = IS_UNUSED;
- dummy_opline.op1 = tmp;
+ dummy_opline.op1_type = IS_UNUSED;
}
zend_stack_push(&CG(foreach_copy_stack), (void *) &dummy_opline, sizeof(zend_op));
/* save the location of FE_FETCH */
- as_token->u.opline_num = get_next_op_number(CG(active_op_array));
+ as_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_FE_FETCH;
- opline->result.op_type = IS_VAR;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- opline->op1 = dummy_opline.result;
+ opline->result_type = IS_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ COPY_NODE(opline->op1, dummy_opline.result);
opline->extended_value = 0;
SET_UNUSED(opline->op2);
@@ -4527,7 +4678,7 @@ void zend_do_foreach_cont(znode *foreach_token, const znode *open_brackets_token
znode dummy, value_node;
zend_bool assign_by_ref=0;
- opline = &CG(active_op_array)->opcodes[as_token->u.opline_num];
+ opline = &CG(active_op_array)->opcodes[as_token->u.op. opline_num];
if (key->op_type != IS_UNUSED) {
znode *tmp;
@@ -4540,38 +4691,38 @@ void zend_do_foreach_cont(znode *foreach_token, const znode *open_brackets_token
opline->extended_value |= ZEND_FE_FETCH_WITH_KEY;
}
- if ((key->op_type != IS_UNUSED) && (key->u.EA.type & ZEND_PARSED_REFERENCE_VARIABLE)) {
+ if ((key->op_type != IS_UNUSED) && (key->EA & ZEND_PARSED_REFERENCE_VARIABLE)) {
zend_error(E_COMPILE_ERROR, "Key element cannot be a reference");
}
- if (value->u.EA.type & ZEND_PARSED_REFERENCE_VARIABLE) {
+ if (value->EA & ZEND_PARSED_REFERENCE_VARIABLE) {
assign_by_ref = 1;
if (!(opline-1)->extended_value) {
zend_error(E_COMPILE_ERROR, "Cannot create references to elements of a temporary array expression");
}
/* Mark extended_value for assign-by-reference */
opline->extended_value |= ZEND_FE_FETCH_BYREF;
- CG(active_op_array)->opcodes[foreach_token->u.opline_num].extended_value |= ZEND_FE_RESET_REFERENCE;
+ CG(active_op_array)->opcodes[foreach_token->u.op.opline_num].extended_value |= ZEND_FE_RESET_REFERENCE;
} else {
zend_op *foreach_copy;
- zend_op *fetch = &CG(active_op_array)->opcodes[foreach_token->u.opline_num];
- zend_op *end = &CG(active_op_array)->opcodes[open_brackets_token->u.opline_num];
+ zend_op *fetch = &CG(active_op_array)->opcodes[foreach_token->u.op.opline_num];
+ zend_op *end = &CG(active_op_array)->opcodes[open_brackets_token->u.op.opline_num];
/* Change "write context" into "read context" */
fetch->extended_value = 0; /* reset ZEND_FE_RESET_VARIABLE */
while (fetch != end) {
--fetch;
- if (fetch->opcode == ZEND_FETCH_DIM_W && fetch->op2.op_type == IS_UNUSED) {
+ if (fetch->opcode == ZEND_FETCH_DIM_W && fetch->op2_type == IS_UNUSED) {
zend_error(E_COMPILE_ERROR, "Cannot use [] for reading");
}
fetch->opcode -= 3; /* FETCH_W -> FETCH_R */
}
/* prevent double SWITCH_FREE */
zend_stack_top(&CG(foreach_copy_stack), (void **) &foreach_copy);
- foreach_copy->op1.op_type = IS_UNUSED;
+ foreach_copy->op1_type = IS_UNUSED;
}
- value_node = opline->result;
+ GET_NODE(&value_node, opline->result);
if (assign_by_ref) {
zend_do_end_variable_parse(value, BP_VAR_W, 0 TSRMLS_CC);
@@ -4585,11 +4736,10 @@ void zend_do_foreach_cont(znode *foreach_token, const znode *open_brackets_token
if (key->op_type != IS_UNUSED) {
znode key_node;
- opline = &CG(active_op_array)->opcodes[as_token->u.opline_num+1];
- opline->result.op_type = IS_TMP_VAR;
- opline->result.u.EA.type = 0;
- opline->result.u.opline_num = get_temporary_variable(CG(active_op_array));
- key_node = opline->result;
+ opline = &CG(active_op_array)->opcodes[as_token->u.op.opline_num+1];
+ opline->result_type = IS_TMP_VAR;
+ opline->result.opline_num = get_temporary_variable(CG(active_op_array));
+ GET_NODE(&key_node, opline->result);
zend_do_assign(&dummy, key, &key_node TSRMLS_CC);
zend_do_free(&dummy TSRMLS_CC);
@@ -4606,14 +4756,14 @@ void zend_do_foreach_end(const znode *foreach_token, const znode *as_token TSRML
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_JMP;
- opline->op1.u.opline_num = as_token->u.opline_num;
+ opline->op1.opline_num = as_token->u.op.opline_num;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
- CG(active_op_array)->opcodes[foreach_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array)); /* FE_RESET */
- CG(active_op_array)->opcodes[as_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array)); /* FE_FETCH */
+ CG(active_op_array)->opcodes[foreach_token->u.op.opline_num].op2.opline_num = get_next_op_number(CG(active_op_array)); /* FE_RESET */
+ CG(active_op_array)->opcodes[as_token->u.op.opline_num].op2.opline_num = get_next_op_number(CG(active_op_array)); /* FE_FETCH */
- do_end_loop(as_token->u.opline_num, 1 TSRMLS_CC);
+ do_end_loop(as_token->u.op.opline_num, 1 TSRMLS_CC);
zend_stack_top(&CG(foreach_copy_stack), (void **) &container_ptr);
generate_free_foreach_copy(container_ptr TSRMLS_CC);
@@ -4701,7 +4851,7 @@ void zend_do_declare_end(const znode *declare_token TSRMLS_DC) /* {{{ */
zend_stack_top(&CG(declare_stack), (void **) &declarables);
/* We should restore if there was more than (current - start) - (ticks?1:0) opcodes */
- if ((get_next_op_number(CG(active_op_array)) - declare_token->u.opline_num) - ((Z_LVAL(CG(declarables).ticks))?1:0)) {
+ if ((get_next_op_number(CG(active_op_array)) - declare_token->u.op.opline_num) - ((Z_LVAL(CG(declarables).ticks))?1:0)) {
CG(declarables) = *declarables;
}
}
@@ -4712,7 +4862,7 @@ void zend_do_exit(znode *result, const znode *message TSRMLS_DC) /* {{{ */
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_EXIT;
- opline->op1 = *message;
+ SET_NODE(opline->op1, message);
SET_UNUSED(opline->op2);
result->op_type = IS_CONST;
@@ -4726,11 +4876,11 @@ void zend_do_begin_silence(znode *strudel_token TSRMLS_DC) /* {{{ */
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_BEGIN_SILENCE;
- opline->result.op_type = IS_TMP_VAR;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
+ opline->result_type = IS_TMP_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
- *strudel_token = opline->result;
+ GET_NODE(strudel_token, opline->result);
}
/* }}} */
@@ -4739,7 +4889,7 @@ void zend_do_end_silence(const znode *strudel_token TSRMLS_DC) /* {{{ */
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_END_SILENCE;
- opline->op1 = *strudel_token;
+ SET_NODE(opline->op1, strudel_token);
SET_UNUSED(opline->op2);
}
/* }}} */
@@ -4750,14 +4900,14 @@ void zend_do_jmp_set(const znode *value, znode *jmp_token, znode *colon_token TS
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_JMP_SET;
- opline->result.op_type = IS_TMP_VAR;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- opline->op1 = *value;
+ opline->result_type = IS_TMP_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ SET_NODE(opline->op1, value);
SET_UNUSED(opline->op2);
- *colon_token = opline->result;
+ GET_NODE(colon_token, opline->result);
- jmp_token->u.opline_num = op_number;
+ jmp_token->u.op .opline_num = op_number;
INC_BPC(CG(active_op_array));
}
@@ -4769,13 +4919,13 @@ void zend_do_jmp_set_else(znode *result, const znode *false_value, const znode *
opline->opcode = ZEND_QM_ASSIGN;
opline->extended_value = 0;
- opline->result = *colon_token;
- opline->op1 = *false_value;
+ SET_NODE(opline->result, colon_token);
+ SET_NODE(opline->op1, false_value);
SET_UNUSED(opline->op2);
- *result = opline->result;
+ GET_NODE(result, opline->result);
- CG(active_op_array)->opcodes[jmp_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array));
+ CG(active_op_array)->opcodes[jmp_token->u.op.opline_num].op2.opline_num = get_next_op_number(CG(active_op_array));
DEC_BPC(CG(active_op_array));
}
@@ -4789,10 +4939,10 @@ void zend_do_begin_qm_op(const znode *cond, znode *qm_token TSRMLS_DC) /* {{{ */
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_JMPZ;
- opline->op1 = *cond;
+ SET_NODE(opline->op1, cond);
SET_UNUSED(opline->op2);
- opline->op2.u.opline_num = jmpz_op_number;
- *qm_token = opline->op2;
+ opline->op2.opline_num = jmpz_op_number;
+ GET_NODE(qm_token, opline->op2);
INC_BPC(CG(active_op_array));
}
@@ -4802,16 +4952,16 @@ void zend_do_qm_true(const znode *true_value, znode *qm_token, znode *colon_toke
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
- CG(active_op_array)->opcodes[qm_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array))+1; /* jmp over the ZEND_JMP */
+ CG(active_op_array)->opcodes[qm_token->u.op.opline_num].op2.opline_num = get_next_op_number(CG(active_op_array))+1; /* jmp over the ZEND_JMP */
opline->opcode = ZEND_QM_ASSIGN;
- opline->result.op_type = IS_TMP_VAR;
- opline->result.u.var = get_temporary_variable(CG(active_op_array));
- opline->op1 = *true_value;
+ opline->result_type = IS_TMP_VAR;
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ SET_NODE(opline->op1, true_value);
SET_UNUSED(opline->op2);
- *qm_token = opline->result;
- colon_token->u.opline_num = get_next_op_number(CG(active_op_array));
+ GET_NODE(qm_token, opline->result);
+ colon_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_JMP;
@@ -4825,13 +4975,13 @@ void zend_do_qm_false(znode *result, const znode *false_value, const znode *qm_t
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_QM_ASSIGN;
- opline->result = *qm_token;
- opline->op1 = *false_value;
+ SET_NODE(opline->result, qm_token);
+ SET_NODE(opline->op1, false_value);
SET_UNUSED(opline->op2);
- CG(active_op_array)->opcodes[colon_token->u.opline_num].op1.u.opline_num = get_next_op_number(CG(active_op_array));
+ CG(active_op_array)->opcodes[colon_token->u.op.opline_num].op1.opline_num = get_next_op_number(CG(active_op_array));
- *result = opline->result;
+ GET_NODE(result, opline->result);
DEC_BPC(CG(active_op_array));
}
@@ -4891,9 +5041,9 @@ void zend_do_ticks(TSRMLS_D) /* {{{ */
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_TICKS;
- opline->op1.u.constant = CG(declarables).ticks;
- opline->op1.op_type = IS_CONST;
+ SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
+ opline->extended_value = Z_LVAL(CG(declarables).ticks);
}
}
/* }}} */
@@ -5269,8 +5419,8 @@ void zend_do_declare_constant(znode *name, znode *value TSRMLS_DC) /* {{{ */
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_DECLARE_CONST;
SET_UNUSED(opline->result);
- opline->op1 = *name;
- opline->op2 = *value;
+ SET_NODE(opline->op1, name);
+ SET_NODE(opline->op2, value);
}
/* }}} */
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index 845fa66..b7185c7 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -34,7 +34,7 @@
#define FREE_PNODE(znode) zval_dtor(&znode->u.constant);
-#define SET_UNUSED(op) (op).op_type = IS_UNUSED
+#define SET_UNUSED(op) op ## _type = IS_UNUSED
#define INC_BPC(op_array) if (op_array->fn_flags & ZEND_ACC_INTERACTIVE) { ((op_array)->backpatch_count++); }
#define DEC_BPC(op_array) if (op_array->fn_flags & ZEND_ACC_INTERACTIVE) { ((op_array)->backpatch_count--); }
@@ -52,20 +52,33 @@
typedef struct _zend_op_array zend_op_array;
typedef struct _zend_op zend_op;
-typedef struct _znode {
+typedef struct _zend_literal {
+ zval constant;
+ ulong hash_value;
+} zend_literal;
+
+#define Z_HASH_P(zv) \
+ (((zend_literal*)(zv))->hash_value)
+
+typedef union _znode_op {
+ zend_uint constant;
+ zend_uint var;
+ zend_uint num;
+ zend_ulong hash;
+ zend_uint opline_num; /* Needs to be signed */
+ zend_op *jmp_addr;
+ zval *zv;
+ zend_literal *literal;
+} znode_op;
+
+typedef struct _znode { /* used only during compilation */
int op_type;
union {
- zval constant;
-
- zend_uint var;
- zend_uint opline_num; /* Needs to be signed */
+ znode_op op;
+ zval constant; /* replaced by literal/zv */
zend_op_array *op_array;
- zend_op *jmp_addr;
- struct {
- zend_uint var; /* dummy */
- zend_uint type;
- } EA;
} u;
+ zend_uint EA; /* extended attributes */
} znode;
typedef struct _zend_execute_data zend_execute_data;
@@ -80,12 +93,15 @@ extern ZEND_API opcode_handler_t *zend_opcode_handlers;
struct _zend_op {
opcode_handler_t handler;
- znode result;
- znode op1;
- znode op2;
+ znode_op op1;
+ znode_op op2;
+ znode_op result;
ulong extended_value;
uint lineno;
zend_uchar opcode;
+ zend_uchar op1_type;
+ zend_uchar op2_type;
+ zend_uchar result_type;
};
@@ -236,6 +252,9 @@ struct _zend_op_array {
zend_uint doc_comment_len;
zend_uint early_binding; /* the linked list of delayed declarations */
+ zend_literal *literals;
+ int last_literal, size_literal;
+
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
};
@@ -335,8 +354,7 @@ struct _zend_execute_data {
#define IS_UNUSED (1<<3) /* Unused variable */
#define IS_CV (1<<4) /* Compiled variable */
-#define EXT_TYPE_UNUSED (1<<0)
-#define EXT_TYPE_FREE_ON_RETURN (2<<0)
+#define EXT_TYPE_UNUSED (1<<5)
#include "zend_globals.h"
@@ -373,7 +391,7 @@ int zend_get_zendleng(TSRMLS_D);
void zend_do_binary_op(zend_uchar op, znode *result, const znode *op1, const znode *op2 TSRMLS_DC);
void zend_do_unary_op(zend_uchar op, znode *result, const znode *op1 TSRMLS_DC);
void zend_do_binary_assign_op(zend_uchar op, znode *result, const znode *op1, const znode *op2 TSRMLS_DC);
-void zend_do_assign(znode *result, znode *variable, const znode *value TSRMLS_DC);
+void zend_do_assign(znode *result, znode *variable, znode *value TSRMLS_DC);
void zend_do_assign_ref(znode *result, const znode *lvar, const znode *rvar TSRMLS_DC);
void fetch_simple_variable(znode *result, znode *varname, int bp TSRMLS_DC);
void fetch_simple_variable_ex(znode *result, znode *varname, int bp, zend_uchar op TSRMLS_DC);
@@ -442,9 +460,9 @@ void zend_do_begin_catch(znode *try_token, znode *catch_class, const znode *catc
void zend_do_end_catch(const znode *try_token TSRMLS_DC);
void zend_do_throw(const znode *expr TSRMLS_DC);
-ZEND_API int do_bind_function(zend_op *opline, HashTable *function_table, zend_bool compile_time);
-ZEND_API zend_class_entry *do_bind_class(const zend_op *opline, HashTable *class_table, zend_bool compile_time TSRMLS_DC);
-ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op *opline, HashTable *class_table, zend_class_entry *parent_ce, zend_bool compile_time TSRMLS_DC);
+ZEND_API int do_bind_function(const zend_op_array *op_array, zend_op *opline, HashTable *function_table, zend_bool compile_time);
+ZEND_API zend_class_entry *do_bind_class(const zend_op_array *op_array, const zend_op *opline, HashTable *class_table, zend_bool compile_time TSRMLS_DC);
+ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op_array *op_array, const zend_op *opline, HashTable *class_table, zend_class_entry *parent_ce, zend_bool compile_time TSRMLS_DC);
ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, const zend_class_entry *iface TSRMLS_DC);
ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC);
void zend_do_implements_interface(znode *interface_znode TSRMLS_DC);
@@ -472,7 +490,6 @@ void zend_do_default_before_statement(const znode *case_list, znode *default_tok
void zend_do_begin_class_declaration(const znode *class_token, znode *class_name, const znode *parent_class_name TSRMLS_DC);
void zend_do_end_class_declaration(const znode *class_token, const znode *parent_token TSRMLS_DC);
void zend_do_declare_property(const znode *var_name, const znode *value, zend_uint access_type TSRMLS_DC);
-void zend_do_declare_implicit_property(TSRMLS_D);
void zend_do_declare_class_constant(znode *var_name, const znode *value TSRMLS_DC);
void zend_do_fetch_property(znode *result, znode *object, const znode *property TSRMLS_DC);
@@ -608,6 +625,8 @@ ZEND_API size_t zend_dirname(char *path, size_t len);
int zendlex(znode *zendlval TSRMLS_DC);
+int zend_add_literal(zend_op_array *op_array, const zval *zv);
+
/* BEGIN: OPCODES */
#include "zend_vm_opcodes.h"
@@ -616,18 +635,6 @@ int zendlex(znode *zendlval TSRMLS_DC);
/* END: OPCODES */
-
-
-
-/* global/local fetches */
-#define ZEND_FETCH_GLOBAL 0
-#define ZEND_FETCH_LOCAL 1
-#define ZEND_FETCH_STATIC 2
-#define ZEND_FETCH_STATIC_MEMBER 3
-#define ZEND_FETCH_GLOBAL_LOCK 4
-#define ZEND_FETCH_LEXICAL 5
-
-
/* class fetches */
#define ZEND_FETCH_CLASS_DEFAULT 0
#define ZEND_FETCH_CLASS_SELF 1
@@ -679,23 +686,36 @@ int zendlex(znode *zendlval TSRMLS_DC);
#define ZEND_REQUIRE (1<<3)
#define ZEND_REQUIRE_ONCE (1<<4)
-#define ZEND_ISSET (1<<0)
-#define ZEND_ISEMPTY (1<<1)
-#define ZEND_ISSET_ISEMPTY_MASK (ZEND_ISSET | ZEND_ISEMPTY)
-#define ZEND_QUICK_SET (1<<2)
-
#define ZEND_CT (1<<0)
#define ZEND_RT (1<<1)
-#define ZEND_FETCH_STANDARD 0
-#define ZEND_FETCH_ADD_LOCK (1<<0)
-#define ZEND_FETCH_MAKE_REF (1<<1)
+/* global/local fetches */
+#define ZEND_FETCH_GLOBAL 0x00000000
+#define ZEND_FETCH_LOCAL 0x10000000
+#define ZEND_FETCH_STATIC 0x20000000
+#define ZEND_FETCH_STATIC_MEMBER 0x30000000
+#define ZEND_FETCH_GLOBAL_LOCK 0x40000000
+#define ZEND_FETCH_LEXICAL 0x50000000
+
+#define ZEND_FETCH_TYPE_MASK 0x70000000
+
+#define ZEND_FETCH_STANDARD 0x00000000
+#define ZEND_FETCH_ADD_LOCK 0x08000000
+#define ZEND_FETCH_MAKE_REF 0x04000000
+
+#define ZEND_ISSET 0x02000000
+#define ZEND_ISEMPTY 0x01000000
+#define ZEND_ISSET_ISEMPTY_MASK (ZEND_ISSET | ZEND_ISEMPTY)
+#define ZEND_QUICK_SET 0x00800000
+
+#define ZEND_FETCH_ARG_MASK 0x000fffff
#define ZEND_FE_FETCH_BYREF 1
#define ZEND_FE_FETCH_WITH_KEY 2
-#define ZEND_FE_RESET_VARIABLE 1
-#define ZEND_FE_RESET_REFERENCE 2
+#define ZEND_FE_RESET_VARIABLE (1<<0)
+#define ZEND_FE_RESET_REFERENCE (1<<1)
+#define EXT_TYPE_FREE_ON_RETURN (1<<2)
#define ZEND_MEMBER_FUNC_CALL 1<<0
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index ae54c5f..f941167 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -48,17 +48,17 @@
typedef int (*incdec_t)(zval *);
-#define get_zval_ptr(node, Ts, should_free, type) _get_zval_ptr(node, Ts, should_free, type TSRMLS_CC)
-#define get_zval_ptr_ptr(node, Ts, should_free, type) _get_zval_ptr_ptr(node, Ts, should_free, type TSRMLS_CC)
-#define get_obj_zval_ptr(node, Ts, should_free, type) _get_obj_zval_ptr(node, Ts, should_free, type TSRMLS_CC)
-#define get_obj_zval_ptr_ptr(node, Ts, should_free, type) _get_obj_zval_ptr_ptr(node, Ts, should_free, type TSRMLS_CC)
+#define get_zval_ptr(op_type, node, Ts, should_free, type) _get_zval_ptr(op_type, node, Ts, should_free, type TSRMLS_CC)
+#define get_zval_ptr_ptr(op_type, node, Ts, should_free, type) _get_zval_ptr_ptr(op_type, node, Ts, should_free, type TSRMLS_CC)
+#define get_obj_zval_ptr(op_type, node, Ts, should_free, type) _get_obj_zval_ptr(op_type, node, Ts, should_free, type TSRMLS_CC)
+#define get_obj_zval_ptr_ptr(op_type, node, Ts, should_free, type) _get_obj_zval_ptr_ptr(op_type, node, Ts, should_free, type TSRMLS_CC)
/* Prototypes */
static void zend_extension_statement_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC);
static void zend_extension_fcall_begin_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC);
static void zend_extension_fcall_end_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC);
-#define RETURN_VALUE_USED(opline) (!((opline)->result.u.EA.type & EXT_TYPE_UNUSED))
+#define RETURN_VALUE_USED(opline) (!((opline)->result_type & EXT_TYPE_UNUSED))
#define EX_T(offset) (*(temp_variable *)((char *) EX(Ts) + offset))
#define T(offset) (*(temp_variable *)((char *) Ts + offset))
@@ -96,8 +96,7 @@ static zend_always_inline void zend_pzval_unlock_free_func(zval *z TSRMLS_DC)
#define PZVAL_UNLOCK_EX(z, f, u) zend_pzval_unlock_func(z, f, u TSRMLS_CC)
#define PZVAL_UNLOCK_FREE(z) zend_pzval_unlock_free_func(z TSRMLS_CC)
#define PZVAL_LOCK(z) Z_ADDREF_P((z))
-#define RETURN_VALUE_UNUSED(pzn) (((pzn)->u.EA.type & EXT_TYPE_UNUSED))
-#define SELECTIVE_PZVAL_LOCK(pzv, pzn) if (!RETURN_VALUE_UNUSED(pzn)) { PZVAL_LOCK(pzv); }
+#define SELECTIVE_PZVAL_LOCK(pzv, opline) if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(pzv); }
#define AI_USE_PTR(ai) \
if ((ai).ptr_ptr) { \
@@ -172,14 +171,14 @@ ZEND_API zval** zend_get_compiled_variable_value(const zend_execute_data *execut
return execute_data_ptr->CVs[var];
}
-static zend_always_inline zval *_get_zval_ptr_tmp(const znode *node, const temp_variable *Ts, zend_free_op *should_free TSRMLS_DC)
+static zend_always_inline zval *_get_zval_ptr_tmp(zend_uint var, const temp_variable *Ts, zend_free_op *should_free TSRMLS_DC)
{
- return should_free->var = &T(node->u.var).tmp_var;
+ return should_free->var = &T(var).tmp_var;
}
-static zval *_get_zval_ptr_var_string_offset(const znode *node, const temp_variable *Ts, zend_free_op *should_free TSRMLS_DC)
+static zval *_get_zval_ptr_var_string_offset(zend_uint var, const temp_variable *Ts, zend_free_op *should_free TSRMLS_DC)
{
- temp_variable *T = &T(node->u.var);
+ temp_variable *T = &T(var);
zval *str = T->str_offset.str;
zval *ptr;
@@ -204,14 +203,14 @@ static zval *_get_zval_ptr_var_string_offset(const znode *node, const temp_varia
return ptr;
}
-static zend_always_inline zval *_get_zval_ptr_var(const znode *node, const temp_variable *Ts, zend_free_op *should_free TSRMLS_DC)
+static zend_always_inline zval *_get_zval_ptr_var(zend_uint var, const temp_variable *Ts, zend_free_op *should_free TSRMLS_DC)
{
- zval *ptr = T(node->u.var).var.ptr;
+ zval *ptr = T(var).var.ptr;
if (EXPECTED(ptr != NULL)) {
PZVAL_UNLOCK(ptr, should_free);
return ptr;
} else {
- return _get_zval_ptr_var_string_offset(node, Ts, should_free TSRMLS_CC);
+ return _get_zval_ptr_var_string_offset(var, Ts, should_free TSRMLS_CC);
}
}
@@ -246,30 +245,30 @@ static zval **_get_zval_cv_lookup(zval ***ptr, zend_uint var, int type TSRMLS_DC
return *ptr;
}
-static zend_always_inline zval *_get_zval_ptr_cv(const znode *node, const temp_variable *Ts, int type TSRMLS_DC)
+static zend_always_inline zval *_get_zval_ptr_cv(zend_uint var, int type TSRMLS_DC)
{
- zval ***ptr = &CV_OF(node->u.var);
+ zval ***ptr = &CV_OF(var);
if (UNEXPECTED(*ptr == NULL)) {
- return *_get_zval_cv_lookup(ptr, node->u.var, type TSRMLS_CC);
+ return *_get_zval_cv_lookup(ptr, var, type TSRMLS_CC);
}
return **ptr;
}
-static inline zval *_get_zval_ptr(znode *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC)
+static inline zval *_get_zval_ptr(int op_type, const znode_op *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC)
{
/* should_free->is_var = 0; */
- switch (node->op_type) {
+ switch (op_type) {
case IS_CONST:
should_free->var = 0;
- return &node->u.constant;
+ return node->zv;
break;
case IS_TMP_VAR:
- should_free->var = TMP_FREE(&T(node->u.var).tmp_var);
- return &T(node->u.var).tmp_var;
+ should_free->var = TMP_FREE(&T(node->var).tmp_var);
+ return &T(node->var).tmp_var;
break;
case IS_VAR:
- return _get_zval_ptr_var(node, Ts, should_free TSRMLS_CC);
+ return _get_zval_ptr_var(node->var, Ts, should_free TSRMLS_CC);
break;
case IS_UNUSED:
should_free->var = 0;
@@ -277,43 +276,43 @@ static inline zval *_get_zval_ptr(znode *node, const temp_variable *Ts, zend_fre
break;
case IS_CV:
should_free->var = 0;
- return _get_zval_ptr_cv(node, Ts, type TSRMLS_CC);
+ return _get_zval_ptr_cv(node->var, type TSRMLS_CC);
break;
EMPTY_SWITCH_DEFAULT_CASE()
}
return NULL;
}
-static zend_always_inline zval **_get_zval_ptr_ptr_var(const znode *node, const temp_variable *Ts, zend_free_op *should_free TSRMLS_DC)
+static zend_always_inline zval **_get_zval_ptr_ptr_var(zend_uint var, const temp_variable *Ts, zend_free_op *should_free TSRMLS_DC)
{
- zval** ptr_ptr = T(node->u.var).var.ptr_ptr;
+ zval** ptr_ptr = T(var).var.ptr_ptr;
if (EXPECTED(ptr_ptr != NULL)) {
PZVAL_UNLOCK(*ptr_ptr, should_free);
} else {
/* string offset */
- PZVAL_UNLOCK(T(node->u.var).str_offset.str, should_free);
+ PZVAL_UNLOCK(T(var).str_offset.str, should_free);
}
return ptr_ptr;
}
-static zend_always_inline zval **_get_zval_ptr_ptr_cv(const znode *node, const temp_variable *Ts, int type TSRMLS_DC)
+static zend_always_inline zval **_get_zval_ptr_ptr_cv(zend_uint var, int type TSRMLS_DC)
{
- zval ***ptr = &CV_OF(node->u.var);
+ zval ***ptr = &CV_OF(var);
if (UNEXPECTED(*ptr == NULL)) {
- return _get_zval_cv_lookup(ptr, node->u.var, type TSRMLS_CC);
+ return _get_zval_cv_lookup(ptr, var, type TSRMLS_CC);
}
return *ptr;
}
-static inline zval **_get_zval_ptr_ptr(const znode *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC)
+static inline zval **_get_zval_ptr_ptr(int op_type, const znode_op *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC)
{
- if (node->op_type == IS_CV) {
+ if (op_type == IS_CV) {
should_free->var = 0;
- return _get_zval_ptr_ptr_cv(node, Ts, type TSRMLS_CC);
- } else if (node->op_type == IS_VAR) {
- return _get_zval_ptr_ptr_var(node, Ts, should_free TSRMLS_CC);
+ return _get_zval_ptr_ptr_cv(node->var, type TSRMLS_CC);
+ } else if (op_type == IS_VAR) {
+ return _get_zval_ptr_ptr_var(node->var, Ts, should_free TSRMLS_CC);
} else {
should_free->var = 0;
return NULL;
@@ -330,9 +329,9 @@ static zend_always_inline zval *_get_obj_zval_ptr_unused(TSRMLS_D)
}
}
-static inline zval **_get_obj_zval_ptr_ptr(const znode *op, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC)
+static inline zval **_get_obj_zval_ptr_ptr(int op_type, const znode_op *op, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC)
{
- if (op->op_type == IS_UNUSED) {
+ if (op_type == IS_UNUSED) {
if (EXPECTED(EG(This) != NULL)) {
/* this should actually never be modified, _ptr_ptr is modified only when
the object is empty */
@@ -342,7 +341,7 @@ static inline zval **_get_obj_zval_ptr_ptr(const znode *op, const temp_variable
zend_error_noreturn(E_ERROR, "Using $this when not in object context");
}
}
- return get_zval_ptr_ptr(op, Ts, should_free, type);
+ return get_zval_ptr_ptr(op_type, op, Ts, should_free, type);
}
static zend_always_inline zval **_get_obj_zval_ptr_ptr_unused(TSRMLS_D)
@@ -355,9 +354,9 @@ static zend_always_inline zval **_get_obj_zval_ptr_ptr_unused(TSRMLS_D)
}
}
-static inline zval *_get_obj_zval_ptr(znode *op, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC)
+static inline zval *_get_obj_zval_ptr(int op_type, znode_op *op, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC)
{
- if (op->op_type == IS_UNUSED) {
+ if (op_type == IS_UNUSED) {
if (EXPECTED(EG(This) != NULL)) {
should_free->var = 0;
return EG(This);
@@ -365,7 +364,7 @@ static inline zval *_get_obj_zval_ptr(znode *op, const temp_variable *Ts, zend_f
zend_error_noreturn(E_ERROR, "Using $this when not in object context");
}
}
- return get_zval_ptr(op, Ts, should_free, type);
+ return get_zval_ptr(op_type, op, Ts, should_free, type);
}
static inline void zend_switch_free(temp_variable *T, int extended_value TSRMLS_DC)
@@ -515,17 +514,15 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva
return 1;
}
-static inline void zend_assign_to_object(znode *result, zval **object_ptr, zval *property_name, znode *value_op, const temp_variable *Ts, int opcode TSRMLS_DC)
-
+static inline void zend_assign_to_object(zval **retval, zval **object_ptr, zval *property_name, int value_type, znode_op *value_op, const temp_variable *Ts, int opcode, const zend_literal *key TSRMLS_DC)
{
zval *object = *object_ptr;
zend_free_op free_value;
- zval *value = get_zval_ptr(value_op, Ts, &free_value, BP_VAR_R);
- zval **retval = &T(result->u.var).var.ptr;
+ zval *value = get_zval_ptr(value_type, value_op, Ts, &free_value, BP_VAR_R);
if (Z_TYPE_P(object) != IS_OBJECT) {
if (object == EG(error_zval_ptr)) {
- if (!RETURN_VALUE_UNUSED(result)) {
+ if (retval) {
*retval = EG(uninitialized_zval_ptr);
PZVAL_LOCK(*retval);
}
@@ -542,7 +539,7 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, zval
zend_error(E_STRICT, "Creating default object from empty value");
} else {
zend_error(E_WARNING, "Attempt to assign property of non-object");
- if (!RETURN_VALUE_UNUSED(result)) {
+ if (retval) {
*retval = EG(uninitialized_zval_ptr);
PZVAL_LOCK(*retval);
}
@@ -552,14 +549,14 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, zval
}
/* separate our value if necessary */
- if (value_op->op_type == IS_TMP_VAR) {
+ if (value_type == IS_TMP_VAR) {
zval *orig_value = value;
ALLOC_ZVAL(value);
*value = *orig_value;
Z_UNSET_ISREF_P(value);
Z_SET_REFCOUNT_P(value, 0);
- } else if (value_op->op_type == IS_CONST) {
+ } else if (value_type == IS_CONST) {
zval *orig_value = value;
ALLOC_ZVAL(value);
@@ -574,19 +571,19 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, zval
if (opcode == ZEND_ASSIGN_OBJ) {
if (!Z_OBJ_HT_P(object)->write_property) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
- if (!RETURN_VALUE_UNUSED(result)) {
+ if (retval) {
*retval = EG(uninitialized_zval_ptr);
PZVAL_LOCK(*retval);
}
- if (value_op->op_type == IS_TMP_VAR) {
+ if (value_type == IS_TMP_VAR) {
FREE_ZVAL(value);
- } else if (value_op->op_type == IS_CONST) {
+ } else if (value_type == IS_CONST) {
zval_ptr_dtor(&value);
}
FREE_OP(free_value);
return;
}
- Z_OBJ_HT_P(object)->write_property(object, property_name, value TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property_name, value, key TSRMLS_CC);
} else {
/* Note: property_name in this case is really the array index! */
if (!Z_OBJ_HT_P(object)->write_dimension) {
@@ -595,8 +592,8 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, zval
Z_OBJ_HT_P(object)->write_dimension(object, property_name, value TSRMLS_CC);
}
- if (!RETURN_VALUE_UNUSED(result) && !EG(exception)) {
- AI_SET_PTR(T(result->u.var).var, value);
+ if (retval && !EG(exception)) {
+ *retval = value;
PZVAL_LOCK(value);
}
zval_ptr_dtor(&value);
@@ -757,9 +754,9 @@ static void zend_extension_fcall_end_handler(const zend_extension *extension, ze
}
-static inline HashTable *zend_get_target_symbol_table(const zend_op *opline, const temp_variable *Ts, int type, const zval *variable TSRMLS_DC)
+static inline HashTable *zend_get_target_symbol_table(int fetch_type TSRMLS_DC)
{
- switch (opline->op2.u.EA.type) {
+ switch (fetch_type) {
case ZEND_FETCH_LOCAL:
if (!EG(active_symbol_table)) {
zend_rebuild_symbol_table(TSRMLS_C);
@@ -782,26 +779,34 @@ static inline HashTable *zend_get_target_symbol_table(const zend_op *opline, con
return NULL;
}
-static inline zval **zend_fetch_dimension_address_inner(HashTable *ht, const zval *dim, int type TSRMLS_DC)
+static inline zval **zend_fetch_dimension_address_inner(HashTable *ht, const zval *dim, int dim_type, int type TSRMLS_DC)
{
zval **retval;
char *offset_key;
int offset_key_length;
long index;
+ ulong hval;
switch (dim->type) {
case IS_NULL:
offset_key = "";
offset_key_length = 0;
+ hval = zend_inline_hash_func("", 1);
goto fetch_string_dim;
case IS_STRING:
offset_key = dim->value.str.val;
offset_key_length = dim->value.str.len;
-
+
+ if (dim_type == IS_CONST) {
+ hval = Z_HASH_P(dim);
+ } else {
+ ZEND_HANDLE_NUMERIC_EX(offset_key, offset_key_length+1, index, goto num_index);
+ hval = zend_hash_func(offset_key, offset_key_length+1);
+ }
fetch_string_dim:
- if (zend_symtable_find(ht, offset_key, offset_key_length+1, (void **) &retval) == FAILURE) {
+ if (zend_hash_quick_find(ht, offset_key, offset_key_length+1, hval, (void **) &retval) == FAILURE) {
switch (type) {
case BP_VAR_R:
zend_error(E_NOTICE, "Undefined index: %s", offset_key);
@@ -817,7 +822,7 @@ fetch_string_dim:
zval *new_zval = &EG(uninitialized_zval);
Z_ADDREF_P(new_zval);
- zend_symtable_update(ht, offset_key, offset_key_length+1, &new_zval, sizeof(zval *), (void **) &retval);
+ zend_hash_quick_update(ht, offset_key, offset_key_length+1, hval, &new_zval, sizeof(zval *), (void **) &retval);
}
break;
}
@@ -864,7 +869,7 @@ num_index:
return retval;
}
-static void zend_fetch_dimension_address(temp_variable *result, zval **container_ptr, zval *dim, int dim_is_tmp_var, int type TSRMLS_DC)
+static void zend_fetch_dimension_address(temp_variable *result, zval **container_ptr, zval *dim, int dim_type, int type TSRMLS_DC)
{
zval *container = *container_ptr;
zval **retval;
@@ -887,7 +892,7 @@ fetch_from_array:
Z_DELREF_P(new_zval);
}
} else {
- retval = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, type TSRMLS_CC);
+ retval = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, dim_type, type TSRMLS_CC);
}
result->var.ptr_ptr = retval;
PZVAL_LOCK(*retval);
@@ -963,7 +968,7 @@ convert_to_array:
} else {
zval *overloaded_result;
- if (dim_is_tmp_var) {
+ if (dim_type == IS_TMP_VAR) {
zval *orig = dim;
MAKE_REAL_ZVAL_PTR(dim);
ZVAL_NULL(orig);
@@ -992,7 +997,7 @@ convert_to_array:
}
AI_SET_PTR(result->var, *retval);
PZVAL_LOCK(*retval);
- if (dim_is_tmp_var) {
+ if (dim_type == IS_TMP_VAR) {
zval_ptr_dtor(&dim);
}
}
@@ -1019,7 +1024,7 @@ convert_to_array:
}
}
-static void zend_fetch_dimension_address_read(temp_variable *result, zval **container_ptr, zval *dim, int dim_is_tmp_var, int type TSRMLS_DC)
+static void zend_fetch_dimension_address_read(temp_variable *result, zval **container_ptr, zval *dim, int dim_type, int type TSRMLS_DC)
{
zval *container = *container_ptr;
zval **retval;
@@ -1027,7 +1032,7 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval **cont
switch (Z_TYPE_P(container)) {
case IS_ARRAY:
- retval = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, type TSRMLS_CC);
+ retval = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, dim_type, type TSRMLS_CC);
if (result) {
AI_SET_PTR(result->var, *retval);
PZVAL_LOCK(*retval);
@@ -1085,7 +1090,7 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval **cont
} else {
zval *overloaded_result;
- if (dim_is_tmp_var) {
+ if (dim_type == IS_TMP_VAR) {
zval *orig = dim;
MAKE_REAL_ZVAL_PTR(dim);
ZVAL_NULL(orig);
@@ -1105,7 +1110,7 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval **cont
AI_SET_PTR(result->var, EG(uninitialized_zval_ptr));
PZVAL_LOCK(EG(uninitialized_zval_ptr));
}
- if (dim_is_tmp_var) {
+ if (dim_type == IS_TMP_VAR) {
zval_ptr_dtor(&dim);
}
}
@@ -1122,7 +1127,7 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval **cont
}
}
-static void zend_fetch_property_address(temp_variable *result, zval **container_ptr, zval *prop_ptr, int type TSRMLS_DC)
+static void zend_fetch_property_address(temp_variable *result, zval **container_ptr, zval *prop_ptr, const zend_literal *key, int type TSRMLS_DC)
{
zval *container = *container_ptr;;
@@ -1152,12 +1157,12 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_
}
if (Z_OBJ_HT_P(container)->get_property_ptr_ptr) {
- zval **ptr_ptr = Z_OBJ_HT_P(container)->get_property_ptr_ptr(container, prop_ptr TSRMLS_CC);
+ zval **ptr_ptr = Z_OBJ_HT_P(container)->get_property_ptr_ptr(container, prop_ptr, key TSRMLS_CC);
if (NULL == ptr_ptr) {
zval *ptr;
if (Z_OBJ_HT_P(container)->read_property &&
- (ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type TSRMLS_CC)) != NULL) {
+ (ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type, key TSRMLS_CC)) != NULL) {
AI_SET_PTR(result->var, ptr);
PZVAL_LOCK(ptr);
} else {
@@ -1168,7 +1173,7 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_
PZVAL_LOCK(*ptr_ptr);
}
} else if (Z_OBJ_HT_P(container)->read_property) {
- zval *ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type TSRMLS_CC);
+ zval *ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type, key TSRMLS_CC);
AI_SET_PTR(result->var, ptr);
PZVAL_LOCK(ptr);
@@ -1179,7 +1184,7 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_
}
}
-static inline zend_brk_cont_element* zend_brk_cont(const zval *nest_levels_zval, int array_offset, const zend_op_array *op_array, const temp_variable *Ts TSRMLS_DC)
+static inline zend_brk_cont_element* zend_brk_cont(zval *nest_levels_zval, int array_offset, const zend_op_array *op_array, const temp_variable *Ts TSRMLS_DC)
{
zval tmp;
int nest_levels, original_nest_levels;
@@ -1204,13 +1209,13 @@ static inline zend_brk_cont_element* zend_brk_cont(const zval *nest_levels_zval,
switch (brk_opline->opcode) {
case ZEND_SWITCH_FREE:
- if (brk_opline->op1.u.EA.type != EXT_TYPE_FREE_ON_RETURN) {
- zend_switch_free(&T(brk_opline->op1.u.var), brk_opline->extended_value TSRMLS_CC);
+ if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) {
+ zend_switch_free(&T(brk_opline->op1.var), brk_opline->extended_value TSRMLS_CC);
}
break;
case ZEND_FREE:
- if (brk_opline->op1.u.EA.type != EXT_TYPE_FREE_ON_RETURN) {
- zendi_zval_dtor(T(brk_opline->op1.u.var).tmp_var);
+ if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) {
+ zendi_zval_dtor(T(brk_opline->op1.var).tmp_var);
}
break;
}
@@ -1256,7 +1261,7 @@ ZEND_API opcode_handler_t *zend_opcode_handlers;
ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, int return_value_used TSRMLS_DC)
{
- zval **return_value_ptr = &(*(temp_variable *)((char *) execute_data_ptr->Ts + execute_data_ptr->opline->result.u.var)).var.ptr;
+ zval **return_value_ptr = &(*(temp_variable *)((char *) execute_data_ptr->Ts + execute_data_ptr->opline->result.var)).var.ptr;
((zend_internal_function *) execute_data_ptr->function_state.function)->handler(execute_data_ptr->opline->extended_value, *return_value_ptr, execute_data_ptr->function_state.function->common.return_reference?return_value_ptr:NULL, execute_data_ptr->object, return_value_used TSRMLS_CC);
}
@@ -1296,12 +1301,12 @@ ZEND_API user_opcode_handler_t zend_get_user_opcode_handler(zend_uchar opcode)
return zend_user_opcode_handlers[opcode];
}
-ZEND_API zval *zend_get_zval_ptr(znode *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC) {
- return get_zval_ptr(node, Ts, should_free, type);
+ZEND_API zval *zend_get_zval_ptr(int op_type, const znode_op *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC) {
+ return get_zval_ptr(op_type, node, Ts, should_free, type);
}
-ZEND_API zval **zend_get_zval_ptr_ptr(const znode *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC) {
- return get_zval_ptr_ptr(node, Ts, should_free, type);
+ZEND_API zval **zend_get_zval_ptr_ptr(int op_type, const znode_op *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC) {
+ return get_zval_ptr_ptr(op_type, node, Ts, should_free, type);
}
/*
diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h
index be493ca..368875c 100644
--- a/Zend/zend_execute.h
+++ b/Zend/zend_execute.h
@@ -71,7 +71,7 @@ static inline void safe_free_zval_ptr_rel(zval *p ZEND_FILE_LINE_DC ZEND_FILE_LI
}
}
ZEND_API int zend_lookup_class(const char *name, int name_length, zend_class_entry ***ce TSRMLS_DC);
-ZEND_API int zend_lookup_class_ex(const char *name, int name_length, int use_autoload, zend_class_entry ***ce TSRMLS_DC);
+ZEND_API int zend_lookup_class_ex(const char *name, int name_length, const zend_literal *key, int use_autoload, zend_class_entry ***ce TSRMLS_DC);
ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name TSRMLS_DC);
ZEND_API int zend_eval_stringl(char *str, int str_len, zval *retval_ptr, char *string_name TSRMLS_DC);
ZEND_API int zend_eval_string_ex(char *str, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC);
@@ -364,6 +364,7 @@ ZEND_API void zend_set_timeout(long seconds, int reset_signals);
ZEND_API void zend_unset_timeout(TSRMLS_D);
ZEND_API void zend_timeout(int dummy);
ZEND_API zend_class_entry *zend_fetch_class(const char *class_name, uint class_name_len, int fetch_type TSRMLS_DC);
+ZEND_API zend_class_entry *zend_fetch_class_by_name(const char *class_name, uint class_name_len, const zend_literal *key, int fetch_type TSRMLS_DC);
void zend_verify_abstract_class(zend_class_entry *ce TSRMLS_DC);
#ifdef ZEND_WIN32
@@ -402,8 +403,8 @@ typedef struct _zend_free_op {
/* int is_var; */
} zend_free_op;
-ZEND_API zval *zend_get_zval_ptr(znode *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC);
-ZEND_API zval **zend_get_zval_ptr_ptr(const znode *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC);
+ZEND_API zval *zend_get_zval_ptr(int op_type, const znode_op *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC);
+ZEND_API zval **zend_get_zval_ptr_ptr(int op_type, const znode_op *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC);
ZEND_API int zend_do_fcall(ZEND_OPCODE_HANDLER_ARGS);
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 1865b6c..d0ce7f1 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -1023,7 +1023,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
}
/* }}} */
-ZEND_API int zend_lookup_class_ex(const char *name, int name_length, int use_autoload, zend_class_entry ***ce TSRMLS_DC) /* {{{ */
+ZEND_API int zend_lookup_class_ex(const char *name, int name_length, const zend_literal *key, int use_autoload, zend_class_entry ***ce TSRMLS_DC) /* {{{ */
{
zval **args[1];
zval autoload_function;
@@ -1038,23 +1038,31 @@ ZEND_API int zend_lookup_class_ex(const char *name, int name_length, int use_aut
ulong hash;
ALLOCA_FLAG(use_heap)
- if (name == NULL || !name_length) {
- return FAILURE;
- }
+ if (key) {
+ lc_name = Z_STRVAL(key->constant);
+ lc_length = Z_STRLEN(key->constant) + 1;
+ hash = key->hash_value;
+ } else {
+ if (name == NULL || !name_length) {
+ return FAILURE;
+ }
- lc_free = lc_name = do_alloca(name_length + 1, use_heap);
- zend_str_tolower_copy(lc_name, name, name_length);
- lc_length = name_length + 1;
+ lc_free = lc_name = do_alloca(name_length + 1, use_heap);
+ zend_str_tolower_copy(lc_name, name, name_length);
+ lc_length = name_length + 1;
- if (lc_name[0] == '\\') {
- lc_name += 1;
- lc_length -= 1;
- }
+ if (lc_name[0] == '\\') {
+ lc_name += 1;
+ lc_length -= 1;
+ }
- hash = zend_inline_hash_func(lc_name, lc_length);
+ hash = zend_inline_hash_func(lc_name, lc_length);
+ }
if (zend_hash_quick_find(EG(class_table), lc_name, lc_length, hash, (void **) ce) == SUCCESS) {
- free_alloca(lc_free, use_heap);
+ if (!key) {
+ free_alloca(lc_free, use_heap);
+ }
return SUCCESS;
}
@@ -1062,7 +1070,9 @@ ZEND_API int zend_lookup_class_ex(const char *name, int name_length, int use_aut
* (doesn't impact fuctionality of __autoload()
*/
if (!use_autoload || zend_is_compiling(TSRMLS_C)) {
- free_alloca(lc_free, use_heap);
+ if (!key) {
+ free_alloca(lc_free, use_heap);
+ }
return FAILURE;
}
@@ -1072,7 +1082,9 @@ ZEND_API int zend_lookup_class_ex(const char *name, int name_length, int use_aut
}
if (zend_hash_quick_add(EG(in_autoload), lc_name, lc_length, hash, (void**)&dummy, sizeof(char), NULL) == FAILURE) {
- free_alloca(lc_free, use_heap);
+ if (!key) {
+ free_alloca(lc_free, use_heap);
+ }
return FAILURE;
}
@@ -1118,20 +1130,19 @@ ZEND_API int zend_lookup_class_ex(const char *name, int name_length, int use_aut
zval_ptr_dtor(&retval_ptr);
}
- if (retval == FAILURE) {
+ if (retval == SUCCESS) {
+ retval = zend_hash_quick_find(EG(class_table), lc_name, lc_length, hash, (void **) ce);
+ }
+ if (!key) {
free_alloca(lc_free, use_heap);
- return FAILURE;
}
-
- retval = zend_hash_quick_find(EG(class_table), lc_name, lc_length, hash, (void **) ce);
- free_alloca(lc_free, use_heap);
return retval;
}
/* }}} */
ZEND_API int zend_lookup_class(const char *name, int name_length, zend_class_entry ***ce TSRMLS_DC) /* {{{ */
{
- return zend_lookup_class_ex(name, name_length, 1, ce TSRMLS_CC);
+ return zend_lookup_class_ex(name, name_length, NULL, 1, ce TSRMLS_CC);
}
/* }}} */
@@ -1249,8 +1260,8 @@ void execute_new_code(TSRMLS_D) /* {{{ */
ret_opline = get_next_op(CG(active_op_array) TSRMLS_CC);
ret_opline->opcode = ZEND_RETURN;
- ret_opline->op1.op_type = IS_CONST;
- INIT_ZVAL(ret_opline->op1.u.constant);
+ ret_opline->op1_type = IS_CONST;
+ ret_opline->op1.constant = zend_add_literal(CG(active_op_array), &EG(uninitialized_zval));
SET_UNUSED(ret_opline->op2);
if (!CG(active_op_array)->start_op) {
@@ -1261,29 +1272,27 @@ void execute_new_code(TSRMLS_D) /* {{{ */
end=CG(active_op_array)->opcodes+CG(active_op_array)->last;
while (opline<end) {
- if (opline->op1.op_type == IS_CONST) {
- Z_SET_ISREF(opline->op1.u.constant);
- Z_SET_REFCOUNT(opline->op1.u.constant, 2); /* Make sure is_ref won't be reset */
+ if (opline->op1_type == IS_CONST) {
+ opline->op1.zv = &CG(active_op_array)->literals[opline->op1.constant].constant;
}
- if (opline->op2.op_type == IS_CONST) {
- Z_SET_ISREF(opline->op2.u.constant);
- Z_SET_REFCOUNT(opline->op2.u.constant, 2);
+ if (opline->op2_type == IS_CONST) {
+ opline->op2.zv = &CG(active_op_array)->literals[opline->op2.constant].constant;
}
switch (opline->opcode) {
case ZEND_GOTO:
- if (Z_TYPE(opline->op2.u.constant) != IS_LONG) {
+ if (Z_TYPE_P(opline->op2.zv) != IS_LONG) {
zend_resolve_goto_label(CG(active_op_array), opline, 1 TSRMLS_CC);
}
/* break omitted intentionally */
case ZEND_JMP:
- opline->op1.u.jmp_addr = &CG(active_op_array)->opcodes[opline->op1.u.opline_num];
+ opline->op1.jmp_addr = &CG(active_op_array)->opcodes[opline->op1.opline_num];
break;
case ZEND_JMPZ:
case ZEND_JMPNZ:
case ZEND_JMPZ_EX:
case ZEND_JMPNZ_EX:
case ZEND_JMP_SET:
- opline->op2.u.jmp_addr = &CG(active_op_array)->opcodes[opline->op2.u.opline_num];
+ opline->op2.jmp_addr = &CG(active_op_array)->opcodes[opline->op2.opline_num];
break;
}
ZEND_VM_SET_OPCODE_HANDLER(opline);
@@ -1547,7 +1556,7 @@ check_fetch_type:
break;
}
- if (zend_lookup_class_ex(class_name, class_name_len, use_autoload, &pce TSRMLS_CC) == FAILURE) {
+ if (zend_lookup_class_ex(class_name, class_name_len, NULL, use_autoload, &pce TSRMLS_CC) == FAILURE) {
if (use_autoload) {
if (!silent && !EG(exception)) {
if (fetch_type == ZEND_FETCH_CLASS_INTERFACE) {
@@ -1563,6 +1572,27 @@ check_fetch_type:
}
/* }}} */
+zend_class_entry *zend_fetch_class_by_name(const char *class_name, uint class_name_len, const zend_literal *key, int fetch_type TSRMLS_DC) /* {{{ */
+{
+ zend_class_entry **pce;
+ int use_autoload = (fetch_type & ZEND_FETCH_CLASS_NO_AUTOLOAD) == 0;
+
+ if (zend_lookup_class_ex(class_name, class_name_len, key, use_autoload, &pce TSRMLS_CC) == FAILURE) {
+ if (use_autoload) {
+ if ((fetch_type & ZEND_FETCH_CLASS_SILENT) == 0 && !EG(exception)) {
+ if ((fetch_type & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_INTERFACE) {
+ zend_error(E_ERROR, "Interface '%s' not found", class_name);
+ } else {
+ zend_error(E_ERROR, "Class '%s' not found", class_name);
+ }
+ }
+ }
+ return NULL;
+ }
+ return *pce;
+}
+/* }}} */
+
#define MAX_ABSTRACT_INFO_CNT 3
#define MAX_ABSTRACT_INFO_FMT "%s%s%s%s"
#define DISPLAY_ABSTRACT_FN(idx) \
@@ -1684,7 +1714,7 @@ ZEND_API void zend_rebuild_symbol_table(TSRMLS_D) /* {{{ */
EG(active_symbol_table) = *(EG(symtable_cache_ptr)--);
} else {
ALLOC_HASHTABLE(EG(active_symbol_table));
- zend_hash_init(EG(active_symbol_table), 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_init(EG(active_symbol_table), ex->op_array->last_var, NULL, ZVAL_PTR_DTOR, 0);
/*printf("Cache miss! Initialized %x\n", EG(active_symbol_table));*/
}
ex->symbol_table = EG(active_symbol_table);
diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h
index bc88e0e..b26e0db 100644
--- a/Zend/zend_hash.h
+++ b/Zend/zend_hash.h
@@ -304,7 +304,7 @@ END_EXTERN_C()
#define ZEND_INIT_SYMTABLE_EX(ht, n, persistent) \
zend_hash_init(ht, n, NULL, ZVAL_PTR_DTOR, persistent)
-#define ZEND_HANDLE_NUMERIC(key, length, func) do { \
+#define ZEND_HANDLE_NUMERIC_EX(key, length, idx, func) do { \
register const char *tmp = key; \
\
if (*tmp == '-') { \
@@ -312,7 +312,6 @@ END_EXTERN_C()
} \
if (*tmp >= '0' && *tmp <= '9') { /* possibly a numeric index */ \
const char *end = key + length - 1; \
- long idx; \
\
if ((*end != '\0') /* not a null terminated string */ \
|| (*tmp == '0' && length > 2) /* numbers with leading zeros */ \
@@ -335,11 +334,17 @@ END_EXTERN_C()
} else if (idx < 0) { /* overflow */ \
break; \
} \
- return func; \
+ func; \
} \
} \
} while (0)
+#define ZEND_HANDLE_NUMERIC(key, length, func) do { \
+ long idx; \
+ \
+ ZEND_HANDLE_NUMERIC_EX(key, length, idx, return func); \
+} while (0)
+
static inline int zend_symtable_update(HashTable *ht, const char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest) \
{
ZEND_HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_update(ht, idx, pData, nDataSize, pDest));
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
index 7738f84..4b891bc 100644
--- a/Zend/zend_language_parser.y
+++ b/Zend/zend_language_parser.y
@@ -219,12 +219,12 @@ unticked_statement:
'{' inner_statement_list '}'
| T_IF '(' expr ')' { zend_do_if_cond(&$3, &$4 TSRMLS_CC); } statement { zend_do_if_after_statement(&$4, 1 TSRMLS_CC); } elseif_list else_single { zend_do_if_end(TSRMLS_C); }
| T_IF '(' expr ')' ':' { zend_do_if_cond(&$3, &$4 TSRMLS_CC); } inner_statement_list { zend_do_if_after_statement(&$4, 1 TSRMLS_CC); } new_elseif_list new_else_single T_ENDIF ';' { zend_do_if_end(TSRMLS_C); }
- | T_WHILE '(' { $1.u.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' { zend_do_while_cond(&$4, &$5 TSRMLS_CC); } while_statement { zend_do_while_end(&$1, &$5 TSRMLS_CC); }
- | T_DO { $1.u.opline_num = get_next_op_number(CG(active_op_array)); zend_do_do_while_begin(TSRMLS_C); } statement T_WHILE '(' { $5.u.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' ';' { zend_do_do_while_end(&$1, &$5, &$7 TSRMLS_CC); }
+ | T_WHILE '(' { $1.u.op.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' { zend_do_while_cond(&$4, &$5 TSRMLS_CC); } while_statement { zend_do_while_end(&$1, &$5 TSRMLS_CC); }
+ | T_DO { $1.u.op.opline_num = get_next_op_number(CG(active_op_array)); zend_do_do_while_begin(TSRMLS_C); } statement T_WHILE '(' { $5.u.op.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' ';' { zend_do_do_while_end(&$1, &$5, &$7 TSRMLS_CC); }
| T_FOR
'('
for_expr
- ';' { zend_do_free(&$3 TSRMLS_CC); $4.u.opline_num = get_next_op_number(CG(active_op_array)); }
+ ';' { zend_do_free(&$3 TSRMLS_CC); $4.u.op.opline_num = get_next_op_number(CG(active_op_array)); }
for_expr
';' { zend_do_extended_info(TSRMLS_C); zend_do_for_cond(&$6, &$7 TSRMLS_CC); }
for_expr
@@ -252,7 +252,7 @@ unticked_statement:
{ zend_do_foreach_begin(&$1, &$2, &$3, &$4, 0 TSRMLS_CC); }
variable foreach_optional_arg ')' { zend_check_writable_variable(&$6); zend_do_foreach_cont(&$1, &$2, &$4, &$6, &$7 TSRMLS_CC); }
foreach_statement { zend_do_foreach_end(&$1, &$4 TSRMLS_CC); }
- | T_DECLARE { $1.u.opline_num = get_next_op_number(CG(active_op_array)); zend_do_declare_begin(TSRMLS_C); } '(' declare_list ')' declare_statement { zend_do_declare_end(&$1 TSRMLS_CC); }
+ | T_DECLARE { $1.u.op.opline_num = get_next_op_number(CG(active_op_array)); zend_do_declare_begin(TSRMLS_C); } '(' declare_list ')' declare_statement { zend_do_declare_end(&$1 TSRMLS_CC); }
| ';' /* empty statement */
| T_TRY { zend_do_try(&$1 TSRMLS_CC); } '{' inner_statement_list '}'
T_CATCH '(' { zend_initialize_try_catch_element(&$1 TSRMLS_CC); }
@@ -267,7 +267,7 @@ unticked_statement:
additional_catches:
non_empty_additional_catches { $$ = $1; }
- | /* empty */ { $$.u.opline_num = -1; }
+ | /* empty */ { $$.u.op.opline_num = -1; }
;
non_empty_additional_catches:
@@ -277,7 +277,7 @@ non_empty_additional_catches:
additional_catch:
- T_CATCH '(' fully_qualified_class_name { $$.u.opline_num = get_next_op_number(CG(active_op_array)); } T_VARIABLE ')' { zend_do_begin_catch(&$1, &$3, &$5, NULL TSRMLS_CC); } '{' inner_statement_list '}' { zend_do_end_catch(&$1 TSRMLS_CC); }
+ T_CATCH '(' fully_qualified_class_name { $$.u.op.opline_num = get_next_op_number(CG(active_op_array)); } T_VARIABLE ')' { zend_do_begin_catch(&$1, &$3, &$5, NULL TSRMLS_CC); } '{' inner_statement_list '}' { zend_do_end_catch(&$1 TSRMLS_CC); }
;
@@ -327,9 +327,9 @@ unticked_class_declaration_statement:
class_entry_type:
- T_CLASS { $$.u.opline_num = CG(zend_lineno); $$.u.EA.type = 0; }
- | T_ABSTRACT T_CLASS { $$.u.opline_num = CG(zend_lineno); $$.u.EA.type = ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; }
- | T_FINAL T_CLASS { $$.u.opline_num = CG(zend_lineno); $$.u.EA.type = ZEND_ACC_FINAL_CLASS; }
+ T_CLASS { $$.u.op.opline_num = CG(zend_lineno); $$.EA = 0; }
+ | T_ABSTRACT T_CLASS { $$.u.op.opline_num = CG(zend_lineno); $$.EA = ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; }
+ | T_FINAL T_CLASS { $$.u.op.opline_num = CG(zend_lineno); $$.EA = ZEND_ACC_FINAL_CLASS; }
;
extends_from:
@@ -338,7 +338,7 @@ extends_from:
;
interface_entry:
- T_INTERFACE { $$.u.opline_num = CG(zend_lineno); $$.u.EA.type = ZEND_ACC_INTERFACE; }
+ T_INTERFACE { $$.u.op.opline_num = CG(zend_lineno); $$.EA = ZEND_ACC_INTERFACE; }
;
interface_extends_list:
@@ -364,7 +364,7 @@ foreach_optional_arg:
foreach_variable:
variable { zend_check_writable_variable(&$1); $$ = $1; }
- | '&' variable { zend_check_writable_variable(&$2); $$ = $2; $$.u.EA.type |= ZEND_PARSED_REFERENCE_VARIABLE; }
+ | '&' variable { zend_check_writable_variable(&$2); $$ = $2; $$.EA |= ZEND_PARSED_REFERENCE_VARIABLE; }
;
for_statement:
@@ -450,14 +450,14 @@ parameter_list:
non_empty_parameter_list:
- optional_class_type T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 TSRMLS_CC); $$.op_type = IS_CONST; Z_LVAL($$.u.constant)=1; Z_TYPE($$.u.constant)=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, &$1, &$2, 0 TSRMLS_CC); }
- | optional_class_type '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$3, 0 TSRMLS_CC); $$.op_type = IS_CONST; Z_LVAL($$.u.constant)=1; Z_TYPE($$.u.constant)=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, &$1, &$3, 1 TSRMLS_CC); }
- | optional_class_type '&' T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$3, 0 TSRMLS_CC); $$.op_type = IS_CONST; Z_LVAL($$.u.constant)=1; Z_TYPE($$.u.constant)=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$5, &$1, &$3, 1 TSRMLS_CC); }
- | optional_class_type T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$2, 0 TSRMLS_CC); $$.op_type = IS_CONST; Z_LVAL($$.u.constant)=1; Z_TYPE($$.u.constant)=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$4, &$1, &$2, 0 TSRMLS_CC); }
- | non_empty_parameter_list ',' optional_class_type T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 TSRMLS_CC); $$=$1; Z_LVAL($$.u.constant)++; zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, &$3, &$4, 0 TSRMLS_CC); }
- | non_empty_parameter_list ',' optional_class_type '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$5, 0 TSRMLS_CC); $$=$1; Z_LVAL($$.u.constant)++; zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, &$3, &$5, 1 TSRMLS_CC); }
- | non_empty_parameter_list ',' optional_class_type '&' T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$5, 0 TSRMLS_CC); $$=$1; Z_LVAL($$.u.constant)++; zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$7, &$3, &$5, 1 TSRMLS_CC); }
- | non_empty_parameter_list ',' optional_class_type T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$4, 0 TSRMLS_CC); $$=$1; Z_LVAL($$.u.constant)++; zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$6, &$3, &$4, 0 TSRMLS_CC); }
+ optional_class_type T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 TSRMLS_CC); $$.op_type = IS_UNUSED; $$.u.op.num=1; Z_TYPE($$.u.constant)=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, &$1, &$2, 0 TSRMLS_CC); }
+ | optional_class_type '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$3, 0 TSRMLS_CC); $$.op_type = IS_UNUSED; $$.u.op.num=1; Z_TYPE($$.u.constant)=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, &$1, &$3, 1 TSRMLS_CC); }
+ | optional_class_type '&' T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$3, 0 TSRMLS_CC); $$.op_type = IS_UNUSED; $$.u.op.num=1; Z_TYPE($$.u.constant)=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$5, &$1, &$3, 1 TSRMLS_CC); }
+ | optional_class_type T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$2, 0 TSRMLS_CC); $$.op_type = IS_UNUSED; $$.u.op.num=1; Z_TYPE($$.u.constant)=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$4, &$1, &$2, 0 TSRMLS_CC); }
+ | non_empty_parameter_list ',' optional_class_type T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 TSRMLS_CC); $$=$1; $$.u.op.num++; zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, &$3, &$4, 0 TSRMLS_CC); }
+ | non_empty_parameter_list ',' optional_class_type '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$5, 0 TSRMLS_CC); $$=$1; $$.u.op.num++; zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, &$3, &$5, 1 TSRMLS_CC); }
+ | non_empty_parameter_list ',' optional_class_type '&' T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$5, 0 TSRMLS_CC); $$=$1; $$.u.op.num++; zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$7, &$3, &$5, 1 TSRMLS_CC); }
+ | non_empty_parameter_list ',' optional_class_type T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$4, 0 TSRMLS_CC); $$=$1; $$.u.op.num++; zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$6, &$3, &$4, 0 TSRMLS_CC); }
;
@@ -580,7 +580,7 @@ expr_without_variable:
T_LIST '(' { zend_do_list_init(TSRMLS_C); } assignment_list ')' '=' expr { zend_do_list_end(&$$, &$7 TSRMLS_CC); }
| variable '=' expr { zend_check_writable_variable(&$1); zend_do_assign(&$$, &$1, &$3 TSRMLS_CC); }
| variable '=' '&' variable { zend_check_writable_variable(&$1); zend_do_end_variable_parse(&$4, BP_VAR_W, 1 TSRMLS_CC); zend_do_end_variable_parse(&$1, BP_VAR_W, 0 TSRMLS_CC); zend_do_assign_ref(&$$, &$1, &$4 TSRMLS_CC); }
- | variable '=' '&' T_NEW class_name_reference { zend_error(E_DEPRECATED, "Assigning the return value of new by reference is deprecated"); zend_check_writable_variable(&$1); zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$4, &$5 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$3, &$4, &$7 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); zend_do_end_variable_parse(&$1, BP_VAR_W, 0 TSRMLS_CC); $3.u.EA.type = ZEND_PARSED_NEW; zend_do_assign_ref(&$$, &$1, &$3 TSRMLS_CC); }
+ | variable '=' '&' T_NEW class_name_reference { zend_error(E_DEPRECATED, "Assigning the return value of new by reference is deprecated"); zend_check_writable_variable(&$1); zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$4, &$5 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$3, &$4, &$7 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); zend_do_end_variable_parse(&$1, BP_VAR_W, 0 TSRMLS_CC); $3.EA = ZEND_PARSED_NEW; zend_do_assign_ref(&$$, &$1, &$3 TSRMLS_CC); }
| T_NEW class_name_reference { zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$1, &$2 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$$, &$1, &$4 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
| T_CLONE expr { zend_do_clone(&$$, &$2 TSRMLS_CC); }
| variable T_PLUS_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(&$1, BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_ADD, &$$, &$1, &$3 TSRMLS_CC); }
@@ -654,7 +654,7 @@ expr_without_variable:
;
function:
- T_FUNCTION { $$.u.opline_num = CG(zend_lineno); }
+ T_FUNCTION { $$.u.op.opline_num = CG(zend_lineno); }
;
lexical_vars:
@@ -670,18 +670,18 @@ lexical_var_list:
;
function_call:
- namespace_name '(' { $2.u.opline_num = zend_do_begin_function_call(&$1, 1 TSRMLS_CC); }
+ namespace_name '(' { $2.u.op.opline_num = zend_do_begin_function_call(&$1, 1 TSRMLS_CC); }
function_call_parameter_list
- ')' { zend_do_end_function_call(&$1, &$$, &$4, 0, $2.u.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
- | T_NAMESPACE T_NS_SEPARATOR namespace_name '(' { $1.op_type = IS_CONST; ZVAL_EMPTY_STRING(&$1.u.constant); zend_do_build_namespace_name(&$1, &$1, &$3 TSRMLS_CC); $4.u.opline_num = zend_do_begin_function_call(&$1, 0 TSRMLS_CC); }
+ ')' { zend_do_end_function_call(&$1, &$$, &$4, 0, $2.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
+ | T_NAMESPACE T_NS_SEPARATOR namespace_name '(' { $1.op_type = IS_CONST; ZVAL_EMPTY_STRING(&$1.u.constant); zend_do_build_namespace_name(&$1, &$1, &$3 TSRMLS_CC); $4.u.op.opline_num = zend_do_begin_function_call(&$1, 0 TSRMLS_CC); }
function_call_parameter_list
- ')' { zend_do_end_function_call(&$1, &$$, &$6, 0, $4.u.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
- | T_NS_SEPARATOR namespace_name '(' { $3.u.opline_num = zend_do_begin_function_call(&$2, 0 TSRMLS_CC); }
+ ')' { zend_do_end_function_call(&$1, &$$, &$6, 0, $4.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
+ | T_NS_SEPARATOR namespace_name '(' { $3.u.op.opline_num = zend_do_begin_function_call(&$2, 0 TSRMLS_CC); }
function_call_parameter_list
- ')' { zend_do_end_function_call(&$2, &$$, &$5, 0, $3.u.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
- | class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING '(' { $4.u.opline_num = zend_do_begin_class_member_function_call(&$1, &$3 TSRMLS_CC); }
+ ')' { zend_do_end_function_call(&$2, &$$, &$5, 0, $3.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
+ | class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING '(' { $4.u.op.opline_num = zend_do_begin_class_member_function_call(&$1, &$3 TSRMLS_CC); }
function_call_parameter_list
- ')' { zend_do_end_function_call($4.u.opline_num?NULL:&$3, &$$, &$6, $4.u.opline_num, $4.u.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
+ ')' { zend_do_end_function_call($4.u.op.opline_num?NULL:&$3, &$$, &$6, $4.u.op.opline_num, $4.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
| class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects '(' { zend_do_end_variable_parse(&$3, BP_VAR_R, 0 TSRMLS_CC); zend_do_begin_class_member_function_call(&$1, &$3 TSRMLS_CC); }
function_call_parameter_list
')' { zend_do_end_function_call(NULL, &$$, &$6, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
@@ -719,8 +719,8 @@ class_name_reference:
dynamic_class_name_reference:
base_variable T_OBJECT_OPERATOR { zend_do_push_object(&$1 TSRMLS_CC); }
- object_property { zend_do_push_object(&$4 TSRMLS_CC); zend_do_declare_implicit_property(TSRMLS_C); } dynamic_class_name_variable_properties
- { zend_do_pop_object(&$$ TSRMLS_CC); $$.u.EA.type = ZEND_PARSED_MEMBER; }
+ object_property { zend_do_push_object(&$4 TSRMLS_CC); } dynamic_class_name_variable_properties
+ { zend_do_pop_object(&$$ TSRMLS_CC); $$.EA = ZEND_PARSED_MEMBER; }
| base_variable { $$ = $1; }
;
@@ -732,7 +732,7 @@ dynamic_class_name_variable_properties:
dynamic_class_name_variable_property:
- T_OBJECT_OPERATOR object_property { zend_do_push_object(&$2 TSRMLS_CC); zend_do_declare_implicit_property(TSRMLS_C); }
+ T_OBJECT_OPERATOR object_property { zend_do_push_object(&$2 TSRMLS_CC); }
;
exit_expr:
@@ -838,26 +838,26 @@ rw_variable:
variable:
base_variable_with_function_calls T_OBJECT_OPERATOR { zend_do_push_object(&$1 TSRMLS_CC); }
object_property { zend_do_push_object(&$4 TSRMLS_CC); } method_or_not variable_properties
- { zend_do_pop_object(&$$ TSRMLS_CC); $$.u.EA.type = $1.u.EA.type | ($7.u.EA.type ? $7.u.EA.type : $6.u.EA.type); }
+ { zend_do_pop_object(&$$ TSRMLS_CC); $$.EA = $1.EA | ($7.EA ? $7.EA : $6.EA); }
| base_variable_with_function_calls { $$ = $1; }
;
variable_properties:
- variable_properties variable_property { $$.u.EA.type = $2.u.EA.type; }
- | /* empty */ { $$.u.EA.type = 0; }
+ variable_properties variable_property { $$.EA = $2.EA; }
+ | /* empty */ { $$.EA = 0; }
;
variable_property:
- T_OBJECT_OPERATOR object_property { zend_do_push_object(&$2 TSRMLS_CC); } method_or_not { $$.u.EA.type = $4.u.EA.type; }
+ T_OBJECT_OPERATOR object_property { zend_do_push_object(&$2 TSRMLS_CC); } method_or_not { $$.EA = $4.EA; }
;
method_or_not:
'(' { zend_do_pop_object(&$1 TSRMLS_CC); zend_do_begin_method_call(&$1 TSRMLS_CC); }
function_call_parameter_list ')'
{ zend_do_end_function_call(&$1, &$$, &$3, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);
- zend_do_push_object(&$$ TSRMLS_CC); $$.u.EA.type = ZEND_PARSED_METHOD_CALL; }
- | /* empty */ { zend_do_declare_implicit_property(TSRMLS_C); $$.u.EA.type = ZEND_PARSED_MEMBER; }
+ zend_do_push_object(&$$ TSRMLS_CC); $$.EA = ZEND_PARSED_METHOD_CALL; }
+ | /* empty */ { $$.EA = ZEND_PARSED_MEMBER; }
;
variable_without_objects:
@@ -877,14 +877,14 @@ variable_class_name:
base_variable_with_function_calls:
base_variable { $$ = $1; }
- | function_call { zend_do_begin_variable_parse(TSRMLS_C); $$ = $1; $$.u.EA.type = ZEND_PARSED_FUNCTION_CALL; }
+ | function_call { zend_do_begin_variable_parse(TSRMLS_C); $$ = $1; $$.EA = ZEND_PARSED_FUNCTION_CALL; }
;
base_variable:
- reference_variable { $$ = $1; $$.u.EA.type = ZEND_PARSED_VARIABLE; }
- | simple_indirect_reference reference_variable { zend_do_indirect_references(&$$, &$1, &$2 TSRMLS_CC); $$.u.EA.type = ZEND_PARSED_VARIABLE; }
- | static_member { $$ = $1; $$.u.EA.type = ZEND_PARSED_STATIC_MEMBER; }
+ reference_variable { $$ = $1; $$.EA = ZEND_PARSED_VARIABLE; }
+ | simple_indirect_reference reference_variable { zend_do_indirect_references(&$$, &$1, &$2 TSRMLS_CC); $$.EA = ZEND_PARSED_VARIABLE; }
+ | static_member { $$ = $1; $$.EA = ZEND_PARSED_STATIC_MEMBER; }
;
reference_variable:
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index 1424a11..0cc3d5c 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -191,12 +191,11 @@ static inline zend_bool is_derived_class(zend_class_entry *child_class, zend_cla
}
/* }}} */
-ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zval *member, int silent TSRMLS_DC) /* {{{ */
+static struct _zend_property_info *zend_get_property_info_quick(zend_class_entry *ce, zval *member, int silent, ulong h TSRMLS_DC) /* {{{ */
{
zend_property_info *property_info = NULL;
zend_property_info *scope_property_info;
zend_bool denied_access = 0;
- ulong h;
if (Z_STRVAL_P(member)[0] == '\0') {
if (!silent) {
@@ -208,7 +207,6 @@ ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce
}
return NULL;
}
- h = zend_get_hash_value(Z_STRVAL_P(member), Z_STRLEN_P(member) + 1);
if (zend_hash_quick_find(&ce->properties_info, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, h, (void **) &property_info)==SUCCESS) {
if(property_info->flags & ZEND_ACC_SHADOW) {
/* if it's a shadow - go to access it's private */
@@ -261,6 +259,14 @@ ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce
}
/* }}} */
+ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zval *member, int silent TSRMLS_DC) /* {{{ */
+{
+ zend_ulong h = zend_get_hash_value(Z_STRVAL_P(member), Z_STRLEN_P(member) + 1);
+
+ return zend_get_property_info_quick(ce, member, silent, h TSRMLS_CC);
+}
+/* }}} */
+
ZEND_API int zend_check_property_access(zend_object *zobj, char *prop_info_name, int prop_info_name_len TSRMLS_DC) /* {{{ */
{
zend_property_info *property_info;
@@ -311,7 +317,7 @@ static int zend_get_property_guard(zend_object *zobj, zend_property_info *proper
}
/* }}} */
-zval *zend_std_read_property(zval *object, zval *member, int type TSRMLS_DC) /* {{{ */
+zval *zend_std_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC) /* {{{ */
{
zend_object *zobj;
zval *tmp_member = NULL;
@@ -330,6 +336,7 @@ zval *zend_std_read_property(zval *object, zval *member, int type TSRMLS_DC) /*
zval_copy_ctor(tmp_member);
convert_to_string(tmp_member);
member = tmp_member;
+ key = NULL;
}
#if DEBUG_OBJECT_HANDLERS
@@ -337,7 +344,11 @@ zval *zend_std_read_property(zval *object, zval *member, int type TSRMLS_DC) /*
#endif
/* make zend_get_property_info silent if we have getter - we may want to use it */
- property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__get != NULL) TSRMLS_CC);
+ if (key) {
+ property_info = zend_get_property_info_quick(zobj->ce, member, (zobj->ce->__get != NULL), key->hash_value TSRMLS_CC);
+ } else {
+ property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__get != NULL) TSRMLS_CC);
+ }
if (!property_info || zend_hash_quick_find(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, (void **) &retval) == FAILURE) {
zend_guard *guard;
@@ -388,7 +399,7 @@ zval *zend_std_read_property(zval *object, zval *member, int type TSRMLS_DC) /*
}
/* }}} */
-static void zend_std_write_property(zval *object, zval *member, zval *value TSRMLS_DC) /* {{{ */
+static void zend_std_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC) /* {{{ */
{
zend_object *zobj;
zval *tmp_member = NULL;
@@ -404,9 +415,14 @@ static void zend_std_write_property(zval *object, zval *member, zval *value TSRM
zval_copy_ctor(tmp_member);
convert_to_string(tmp_member);
member = tmp_member;
+ key = NULL;
}
- property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__set != NULL) TSRMLS_CC);
+ if (key) {
+ property_info = zend_get_property_info_quick(zobj->ce, member, (zobj->ce->__set != NULL), key->hash_value TSRMLS_CC);
+ } else {
+ property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__set != NULL) TSRMLS_CC);
+ }
if (property_info && zend_hash_quick_find(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, (void **) &variable_ptr) == SUCCESS) {
/* if we already have this value there, we don't actually need to do anything */
@@ -552,7 +568,7 @@ static int zend_std_has_dimension(zval *object, zval *offset, int check_empty TS
}
/* }}} */
-static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC) /* {{{ */
+static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member, const zend_literal *key TSRMLS_DC) /* {{{ */
{
zend_object *zobj;
zval tmp_member;
@@ -566,13 +582,18 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC
zval_copy_ctor(&tmp_member);
convert_to_string(&tmp_member);
member = &tmp_member;
+ key = NULL;
}
#if DEBUG_OBJECT_HANDLERS
fprintf(stderr, "Ptr object #%d property: %s\n", Z_OBJ_HANDLE_P(object), Z_STRVAL_P(member));
#endif
- property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__get != NULL) TSRMLS_CC);
+ if (key) {
+ property_info = zend_get_property_info_quick(zobj->ce, member, (zobj->ce->__get != NULL), key->hash_value TSRMLS_CC);
+ } else {
+ property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__get != NULL) TSRMLS_CC);
+ }
if (!property_info || zend_hash_quick_find(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, (void **) &retval) == FAILURE) {
zval *new_zval;
@@ -599,7 +620,7 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC
}
/* }}} */
-static void zend_std_unset_property(zval *object, zval *member TSRMLS_DC) /* {{{ */
+static void zend_std_unset_property(zval *object, zval *member, const zend_literal *key TSRMLS_DC) /* {{{ */
{
zend_object *zobj;
zval *tmp_member = NULL;
@@ -614,9 +635,14 @@ static void zend_std_unset_property(zval *object, zval *member TSRMLS_DC) /* {{{
zval_copy_ctor(tmp_member);
convert_to_string(tmp_member);
member = tmp_member;
+ key = NULL;
}
- property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__unset != NULL) TSRMLS_CC);
+ if (key) {
+ property_info = zend_get_property_info_quick(zobj->ce, member, (zobj->ce->__unset != NULL), key->hash_value TSRMLS_CC);
+ } else {
+ property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__unset != NULL) TSRMLS_CC);
+ }
if (!property_info || zend_hash_quick_del(zobj->properties, property_info->name, property_info->name_length+1, property_info->h) == FAILURE) {
zend_guard *guard;
@@ -702,7 +728,7 @@ ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{ */
* Returns the function address that should be called, or NULL
* if no such function exists.
*/
-static inline zend_function *zend_check_private_int(zend_function *fbc, zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC) /* {{{ */
+static inline zend_function *zend_check_private_int(zend_function *fbc, zend_class_entry *ce, char *function_name_strval, int function_name_strlen, ulong hash_value TSRMLS_DC) /* {{{ */
{
if (!ce) {
return 0;
@@ -724,7 +750,7 @@ static inline zend_function *zend_check_private_int(zend_function *fbc, zend_cla
ce = ce->parent;
while (ce) {
if (ce == EG(scope)) {
- if (zend_hash_find(&ce->function_table, function_name_strval, function_name_strlen+1, (void **) &fbc)==SUCCESS
+ if (zend_hash_quick_find(&ce->function_table, function_name_strval, function_name_strlen+1, hash_value, (void **) &fbc)==SUCCESS
&& fbc->op_array.fn_flags & ZEND_ACC_PRIVATE
&& fbc->common.scope == EG(scope)) {
return fbc;
@@ -739,7 +765,7 @@ static inline zend_function *zend_check_private_int(zend_function *fbc, zend_cla
ZEND_API int zend_check_private(zend_function *fbc, zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC) /* {{{ */
{
- return zend_check_private_int(fbc, ce, function_name_strval, function_name_strlen TSRMLS_CC) != NULL;
+ return zend_check_private_int(fbc, ce, function_name_strval, function_name_strlen, zend_hash_func(function_name_strval, function_name_strlen+1) TSRMLS_CC) != NULL;
}
/* }}} */
@@ -796,21 +822,29 @@ static inline union _zend_function *zend_get_user_call_function(zend_class_entry
}
/* }}} */
-static union _zend_function *zend_std_get_method(zval **object_ptr, char *method_name, int method_len TSRMLS_DC) /* {{{ */
+static union _zend_function *zend_std_get_method(zval **object_ptr, char *method_name, int method_len, const zend_literal *key TSRMLS_DC) /* {{{ */
{
- zend_object *zobj;
zend_function *fbc;
- char *lc_method_name;
zval *object = *object_ptr;
+ zend_object *zobj = Z_OBJ_P(object);
+ ulong hash_value;
+ char *lc_method_name;
ALLOCA_FLAG(use_heap)
- lc_method_name = do_alloca(method_len+1, use_heap);
- /* Create a zend_copy_str_tolower(dest, src, src_length); */
- zend_str_tolower_copy(lc_method_name, method_name, method_len);
+ if (key) {
+ lc_method_name = Z_STRVAL(key->constant);
+ hash_value = key->hash_value;
+ } else {
+ lc_method_name = do_alloca(method_len+1, use_heap);
+ /* Create a zend_copy_str_tolower(dest, src, src_length); */
+ zend_str_tolower_copy(lc_method_name, method_name, method_len);
+ hash_value = zend_hash_func(lc_method_name, method_len+1);
+ }
- zobj = Z_OBJ_P(object);
- if (zend_hash_find(&zobj->ce->function_table, lc_method_name, method_len+1, (void **)&fbc) == FAILURE) {
- free_alloca(lc_method_name, use_heap);
+ if (zend_hash_quick_find(&zobj->ce->function_table, lc_method_name, method_len+1, hash_value, (void **)&fbc) == FAILURE) {
+ if (!key) {
+ free_alloca(lc_method_name, use_heap);
+ }
if (zobj->ce->__call) {
return zend_get_user_call_function(zobj->ce, method_name, method_len);
} else {
@@ -825,7 +859,7 @@ static union _zend_function *zend_std_get_method(zval **object_ptr, char *method
/* Ensure that if we're calling a private function, we're allowed to do so.
* If we're not and __call() handler exists, invoke it, otherwise error out.
*/
- updated_fbc = zend_check_private_int(fbc, Z_OBJ_HANDLER_P(object, get_class_entry)(object TSRMLS_CC), lc_method_name, method_len TSRMLS_CC);
+ updated_fbc = zend_check_private_int(fbc, Z_OBJ_HANDLER_P(object, get_class_entry)(object TSRMLS_CC), lc_method_name, method_len, hash_value TSRMLS_CC);
if (updated_fbc) {
fbc = updated_fbc;
} else {
@@ -844,7 +878,7 @@ static union _zend_function *zend_std_get_method(zval **object_ptr, char *method
fbc->op_array.fn_flags & ZEND_ACC_CHANGED) {
zend_function *priv_fbc;
- if (zend_hash_find(&EG(scope)->function_table, lc_method_name, method_len+1, (void **) &priv_fbc)==SUCCESS
+ if (zend_hash_quick_find(&EG(scope)->function_table, lc_method_name, method_len+1, hash_value, (void **) &priv_fbc)==SUCCESS
&& priv_fbc->common.fn_flags & ZEND_ACC_PRIVATE
&& priv_fbc->common.scope == EG(scope)) {
fbc = priv_fbc;
@@ -864,7 +898,9 @@ static union _zend_function *zend_std_get_method(zval **object_ptr, char *method
}
}
- free_alloca(lc_method_name, use_heap);
+ if (!key) {
+ free_alloca(lc_method_name, use_heap);
+ }
return fbc;
}
/* }}} */
@@ -933,13 +969,23 @@ static inline union _zend_function *zend_get_user_callstatic_function(zend_class
/* This is not (yet?) in the API, but it belongs in the built-in objects callbacks */
-ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC) /* {{{ */
+ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, char *function_name_strval, int function_name_strlen, const zend_literal *key TSRMLS_DC) /* {{{ */
{
zend_function *fbc = NULL;
char *lc_class_name, *lc_function_name = NULL;
-
- lc_function_name = zend_str_tolower_dup(function_name_strval, function_name_strlen);
+ ulong hash_value;
+ ALLOCA_FLAG(use_heap)
+ if (key) {
+ lc_function_name = Z_STRVAL(key->constant);
+ hash_value = key->hash_value;
+ } else {
+ lc_function_name = do_alloca(function_name_strlen+1, use_heap);
+ /* Create a zend_copy_str_tolower(dest, src, src_length); */
+ zend_str_tolower_copy(lc_function_name, function_name_strval, function_name_strlen);
+ hash_value = zend_hash_func(lc_function_name, function_name_strlen+1);
+ }
+
if (function_name_strlen == ce->name_length && ce->constructor) {
lc_class_name = zend_str_tolower_dup(ce->name, ce->name_length);
/* Only change the method to the constructor if the constructor isn't called __construct
@@ -950,8 +996,10 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, char *f
}
efree(lc_class_name);
}
- if (!fbc && zend_hash_find(&ce->function_table, lc_function_name, function_name_strlen+1, (void **) &fbc)==FAILURE) {
- efree(lc_function_name);
+ if (!fbc && zend_hash_quick_find(&ce->function_table, lc_function_name, function_name_strlen+1, hash_value, (void **) &fbc)==FAILURE) {
+ if (!key) {
+ free_alloca(lc_function_name, use_heap);
+ }
if (ce->__callstatic) {
return zend_get_user_callstatic_function(ce, function_name_strval, function_name_strlen);
@@ -964,7 +1012,6 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, char *f
return NULL;
}
}
- efree(lc_function_name);
#if MBO_0
/* right now this function is used for non static method lookup too */
@@ -980,42 +1027,55 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, char *f
/* Ensure that if we're calling a private function, we're allowed to do so.
*/
- updated_fbc = zend_check_private_int(fbc, EG(scope), function_name_strval, function_name_strlen TSRMLS_CC);
+ updated_fbc = zend_check_private_int(fbc, EG(scope), lc_function_name, function_name_strlen, hash_value TSRMLS_CC);
if (updated_fbc) {
fbc = updated_fbc;
} else {
if (ce->__callstatic) {
- return zend_get_user_callstatic_function(ce, function_name_strval, function_name_strlen);
+ fbc = zend_get_user_callstatic_function(ce, function_name_strval, function_name_strlen);
+ } else {
+ zend_error(E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), function_name_strval, EG(scope) ? EG(scope)->name : "");
}
- zend_error(E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), function_name_strval, EG(scope) ? EG(scope)->name : "");
}
} else if ((fbc->common.fn_flags & ZEND_ACC_PROTECTED)) {
/* Ensure that if we're calling a protected function, we're allowed to do so.
*/
if (!zend_check_protected(zend_get_function_root_class(fbc), EG(scope))) {
if (ce->__callstatic) {
- return zend_get_user_callstatic_function(ce, function_name_strval, function_name_strlen);
+ fbc = zend_get_user_callstatic_function(ce, function_name_strval, function_name_strlen);
+ } else {
+ zend_error(E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), function_name_strval, EG(scope) ? EG(scope)->name : "");
}
- zend_error(E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), function_name_strval, EG(scope) ? EG(scope)->name : "");
}
}
+ if (!key) {
+ free_alloca(lc_function_name, use_heap);
+ }
+
return fbc;
}
/* }}} */
-ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, char *property_name, int property_name_len, zend_bool silent TSRMLS_DC) /* {{{ */
+ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, char *property_name, int property_name_len, zend_bool silent, const zend_literal *key TSRMLS_DC) /* {{{ */
{
zval **retval = NULL;
zend_class_entry *tmp_ce = ce;
zend_property_info *property_info;
zend_property_info std_property_info;
+ ulong hash_value;
+
+ if (key) {
+ hash_value = key->hash_value;
+ } else {
+ hash_value = zend_hash_func(property_name, property_name_len+1);
+ }
- if (zend_hash_find(&ce->properties_info, property_name, property_name_len+1, (void **) &property_info)==FAILURE) {
+ if (zend_hash_quick_find(&ce->properties_info, property_name, property_name_len+1, hash_value, (void **) &property_info)==FAILURE) {
std_property_info.flags = ZEND_ACC_PUBLIC;
std_property_info.name = property_name;
std_property_info.name_length = property_name_len;
- std_property_info.h = zend_get_hash_value(std_property_info.name, std_property_info.name_length+1);
+ std_property_info.h = hash_value;
std_property_info.ce = ce;
property_info = &std_property_info;
}
@@ -1047,7 +1107,7 @@ ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, char *propert
}
/* }}} */
-ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, char *property_name, int property_name_len TSRMLS_DC) /* {{{ */
+ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, char *property_name, int property_name_len, const zend_literal *key TSRMLS_DC) /* {{{ */
{
zend_error(E_ERROR, "Attempt to unset static property %s::$%s", ce->name, property_name);
return 0;
@@ -1107,7 +1167,7 @@ static int zend_std_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int zend_std_has_property(zval *object, zval *member, int has_set_exists TSRMLS_DC) /* {{{ */
+static int zend_std_has_property(zval *object, zval *member, int has_set_exists, const zend_literal *key TSRMLS_DC) /* {{{ */
{
zend_object *zobj;
int result;
@@ -1124,13 +1184,18 @@ static int zend_std_has_property(zval *object, zval *member, int has_set_exists
zval_copy_ctor(tmp_member);
convert_to_string(tmp_member);
member = tmp_member;
+ key = NULL;
}
#if DEBUG_OBJECT_HANDLERS
fprintf(stderr, "Read object #%d property: %s\n", Z_OBJ_HANDLE_P(object), Z_STRVAL_P(member));
#endif
- property_info = zend_get_property_info(zobj->ce, member, 1 TSRMLS_CC);
+ if (key) {
+ property_info = zend_get_property_info_quick(zobj->ce, member, 1, key->hash_value TSRMLS_CC);
+ } else {
+ property_info = zend_get_property_info(zobj->ce, member, 1 TSRMLS_CC);
+ }
if (!property_info || zend_hash_quick_find(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, (void **) &value) == FAILURE) {
zend_guard *guard;
diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h
index 34f4e02..611ba87 100644
--- a/Zend/zend_object_handlers.h
+++ b/Zend/zend_object_handlers.h
@@ -24,13 +24,14 @@
union _zend_function;
struct _zend_property_info;
+struct _zend_literal;
/* The following rule applies to read_property() and read_dimension() implementations:
If you return a zval which is not otherwise referenced by the extension or the engine's
symbol table, its reference count should be 0.
*/
/* Used to fetch property from the object, read-only */
-typedef zval *(*zend_object_read_property_t)(zval *object, zval *member, int type TSRMLS_DC);
+typedef zval *(*zend_object_read_property_t)(zval *object, zval *member, int type, const struct _zend_literal *key TSRMLS_DC);
/* Used to fetch dimension from the object, read-only */
typedef zval *(*zend_object_read_dimension_t)(zval *object, zval *offset, int type TSRMLS_DC);
@@ -42,14 +43,14 @@ typedef zval *(*zend_object_read_dimension_t)(zval *object, zval *offset, int ty
any changes. You should NOT modify the reference count of the value passed to you.
*/
/* Used to set property of the object */
-typedef void (*zend_object_write_property_t)(zval *object, zval *member, zval *value TSRMLS_DC);
+typedef void (*zend_object_write_property_t)(zval *object, zval *member, zval *value, const struct _zend_literal *key TSRMLS_DC);
/* Used to set dimension of the object */
typedef void (*zend_object_write_dimension_t)(zval *object, zval *offset, zval *value TSRMLS_DC);
/* Used to create pointer to the property of the object, for future direct r/w access */
-typedef zval **(*zend_object_get_property_ptr_ptr_t)(zval *object, zval *member TSRMLS_DC);
+typedef zval **(*zend_object_get_property_ptr_ptr_t)(zval *object, zval *member, const struct _zend_literal *key TSRMLS_DC);
/* Used to set object value. Can be used to override assignments and scalar
write ops (like ++, +=) on the object */
@@ -66,13 +67,13 @@ typedef zval* (*zend_object_get_t)(zval *object TSRMLS_DC);
* 1 (set) whether property exists and is true
* 2 (exists) whether property exists
*/
-typedef int (*zend_object_has_property_t)(zval *object, zval *member, int has_set_exists TSRMLS_DC);
+typedef int (*zend_object_has_property_t)(zval *object, zval *member, int has_set_exists, const struct _zend_literal *key TSRMLS_DC);
/* Used to check if a dimension of the object exists */
typedef int (*zend_object_has_dimension_t)(zval *object, zval *member, int check_empty TSRMLS_DC);
/* Used to remove a property of the object */
-typedef void (*zend_object_unset_property_t)(zval *object, zval *member TSRMLS_DC);
+typedef void (*zend_object_unset_property_t)(zval *object, zval *member, const struct _zend_literal *key TSRMLS_DC);
/* Used to remove a dimension of the object */
typedef void (*zend_object_unset_dimension_t)(zval *object, zval *offset TSRMLS_DC);
@@ -87,7 +88,7 @@ typedef HashTable *(*zend_object_get_debug_info_t)(zval *object, int *is_temp TS
/* Andi - EX(fbc) (function being called) needs to be initialized already in the INIT fcall opcode so that the parameters can be parsed the right way. We need to add another callback for this.
*/
typedef int (*zend_object_call_method_t)(char *method, INTERNAL_FUNCTION_PARAMETERS);
-typedef union _zend_function *(*zend_object_get_method_t)(zval **object_ptr, char *method, int method_len TSRMLS_DC);
+typedef union _zend_function *(*zend_object_get_method_t)(zval **object_ptr, char *method, int method_len, const struct _zend_literal *key TSRMLS_DC);
typedef union _zend_function *(*zend_object_get_constructor_t)(zval *object TSRMLS_DC);
/* Object maintenance/destruction */
@@ -143,9 +144,9 @@ struct _zend_object_handlers {
extern ZEND_API zend_object_handlers std_object_handlers;
BEGIN_EXTERN_C()
-ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC);
-ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, char *property_name, int property_name_len, zend_bool silent TSRMLS_DC);
-ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, char *property_name, int property_name_len TSRMLS_DC);
+ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce, char *function_name_strval, int function_name_strlen, const struct _zend_literal *key TSRMLS_DC);
+ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, char *property_name, int property_name_len, zend_bool silent, const struct _zend_literal *key TSRMLS_DC);
+ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, char *property_name, int property_name_len, const struct _zend_literal *key TSRMLS_DC);
ZEND_API union _zend_function *zend_std_get_constructor(zval *object TSRMLS_DC);
ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zval *member, int silent TSRMLS_DC);
ZEND_API HashTable *zend_std_get_properties(zval *object TSRMLS_DC);
diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c
index b1eed8e..3587e99 100644
--- a/Zend/zend_objects_API.c
+++ b/Zend/zend_objects_API.c
@@ -353,7 +353,7 @@ ZEND_API void zend_object_proxy_set(zval **property, zval *value TSRMLS_DC)
zend_proxy_object *probj = zend_object_store_get_object(*property TSRMLS_CC);
if (Z_OBJ_HT_P(probj->object) && Z_OBJ_HT_P(probj->object)->write_property) {
- Z_OBJ_HT_P(probj->object)->write_property(probj->object, probj->property, value TSRMLS_CC);
+ Z_OBJ_HT_P(probj->object)->write_property(probj->object, probj->property, value, 0 TSRMLS_CC);
} else {
zend_error(E_WARNING, "Cannot write property of object - no write handler defined");
}
@@ -364,7 +364,7 @@ ZEND_API zval* zend_object_proxy_get(zval *property TSRMLS_DC)
zend_proxy_object *probj = zend_object_store_get_object(property TSRMLS_CC);
if (Z_OBJ_HT_P(probj->object) && Z_OBJ_HT_P(probj->object)->read_property) {
- return Z_OBJ_HT_P(probj->object)->read_property(probj->object, probj->property, BP_VAR_R TSRMLS_CC);
+ return Z_OBJ_HT_P(probj->object)->read_property(probj->object, probj->property, BP_VAR_R, 0 TSRMLS_CC);
} else {
zend_error(E_WARNING, "Cannot read property of object - no read handler defined");
}
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index 2a0cfd9..9fdbd70 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -67,7 +67,7 @@ void init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_siz
op_array->opcodes = NULL;
op_array_alloc_ops(op_array);
- op_array->size_var = 0; /* FIXME:??? */
+ op_array->size_var = 0;
op_array->last_var = 0;
op_array->vars = NULL;
@@ -103,6 +103,10 @@ void init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_siz
op_array->early_binding = -1;
+ op_array->size_literal = 0;
+ op_array->last_literal = 0;
+ op_array->literals = NULL;
+
memset(op_array->reserved, 0, ZEND_MAX_RESERVED_RESOURCES * sizeof(void*));
zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_ctor_handler, op_array TSRMLS_CC);
@@ -220,8 +224,8 @@ void zend_class_add_ref(zend_class_entry **ce)
ZEND_API void destroy_op_array(zend_op_array *op_array TSRMLS_DC)
{
- zend_op *opline = op_array->opcodes;
- zend_op *end = op_array->opcodes+op_array->last;
+ zend_literal *literal = op_array->literals;
+ zend_literal *end;
zend_uint i;
if (op_array->static_variables) {
@@ -244,20 +248,13 @@ ZEND_API void destroy_op_array(zend_op_array *op_array TSRMLS_DC)
efree(op_array->vars);
}
- while (opline<end) {
- if (opline->op1.op_type==IS_CONST) {
-#if DEBUG_ZEND>2
- printf("Reducing refcount for %x 1=>0 (destroying)\n", &opline->op1.u.constant);
-#endif
- zval_dtor(&opline->op1.u.constant);
- }
- if (opline->op2.op_type==IS_CONST) {
-#if DEBUG_ZEND>2
- printf("Reducing refcount for %x 1=>0 (destroying)\n", &opline->op2.u.constant);
-#endif
- zval_dtor(&opline->op2.u.constant);
+ if (literal) {
+ end = literal + op_array->last_literal;
+ while (literal < end) {
+ zval_dtor(&literal->constant);
+ literal++;
}
- opline++;
+ efree(op_array->literals);
}
efree(op_array->opcodes);
@@ -377,39 +374,41 @@ ZEND_API int pass_two(zend_op_array *op_array TSRMLS_DC)
op_array->opcodes = (zend_op *) erealloc(op_array->opcodes, sizeof(zend_op)*op_array->last);
op_array->size = op_array->last;
}
+ if (!(op_array->fn_flags & ZEND_ACC_INTERACTIVE) && op_array->size_literal != op_array->last_literal) {
+ op_array->literals = (zend_literal*)erealloc(op_array->literals, sizeof(zend_literal) * op_array->last_literal);
+ op_array->size_literal = op_array->last_literal;
+ }
opline = op_array->opcodes;
end = opline + op_array->last;
while (opline < end) {
- if (opline->op1.op_type == IS_CONST) {
- Z_SET_ISREF(opline->op1.u.constant);
- Z_SET_REFCOUNT(opline->op1.u.constant, 2); /* Make sure is_ref won't be reset */
+ if (opline->op1_type == IS_CONST) {
+ opline->op1.zv = &op_array->literals[opline->op1.constant].constant;
}
- if (opline->op2.op_type == IS_CONST) {
- Z_SET_ISREF(opline->op2.u.constant);
- Z_SET_REFCOUNT(opline->op2.u.constant, 2);
+ if (opline->op2_type == IS_CONST) {
+ opline->op2.zv = &op_array->literals[opline->op2.constant].constant;
}
switch (opline->opcode) {
case ZEND_GOTO:
- if (Z_TYPE(opline->op2.u.constant) != IS_LONG) {
+ if (Z_TYPE_P(opline->op2.zv) != IS_LONG) {
zend_resolve_goto_label(op_array, opline, 1 TSRMLS_CC);
}
/* break omitted intentionally */
case ZEND_JMP:
- opline->op1.u.jmp_addr = &op_array->opcodes[opline->op1.u.opline_num];
+ opline->op1.jmp_addr = &op_array->opcodes[opline->op1.opline_num];
break;
case ZEND_JMPZ:
case ZEND_JMPNZ:
case ZEND_JMPZ_EX:
case ZEND_JMPNZ_EX:
case ZEND_JMP_SET:
- opline->op2.u.jmp_addr = &op_array->opcodes[opline->op2.u.opline_num];
+ opline->op2.jmp_addr = &op_array->opcodes[opline->op2.opline_num];
break;
}
ZEND_VM_SET_OPCODE_HANDLER(opline);
opline++;
}
-
+
op_array->done_pass_two = 1;
return 0;
}
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index fd04ff0..0fe828d 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -30,7 +30,7 @@ ZEND_VM_HANDLER(1, ZEND_ADD, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- add_function(&EX_T(opline->result.u.var).tmp_var,
+ add_function(&EX_T(opline->result.var).tmp_var,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
FREE_OP1();
@@ -43,7 +43,7 @@ ZEND_VM_HANDLER(2, ZEND_SUB, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- sub_function(&EX_T(opline->result.u.var).tmp_var,
+ sub_function(&EX_T(opline->result.var).tmp_var,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
FREE_OP1();
@@ -56,7 +56,7 @@ ZEND_VM_HANDLER(3, ZEND_MUL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- mul_function(&EX_T(opline->result.u.var).tmp_var,
+ mul_function(&EX_T(opline->result.var).tmp_var,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
FREE_OP1();
@@ -69,7 +69,7 @@ ZEND_VM_HANDLER(4, ZEND_DIV, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- div_function(&EX_T(opline->result.u.var).tmp_var,
+ div_function(&EX_T(opline->result.var).tmp_var,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
FREE_OP1();
@@ -82,7 +82,7 @@ ZEND_VM_HANDLER(5, ZEND_MOD, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- mod_function(&EX_T(opline->result.u.var).tmp_var,
+ mod_function(&EX_T(opline->result.var).tmp_var,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
FREE_OP1();
@@ -95,7 +95,7 @@ ZEND_VM_HANDLER(6, ZEND_SL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- shift_left_function(&EX_T(opline->result.u.var).tmp_var,
+ shift_left_function(&EX_T(opline->result.var).tmp_var,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
FREE_OP1();
@@ -108,7 +108,7 @@ ZEND_VM_HANDLER(7, ZEND_SR, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- shift_right_function(&EX_T(opline->result.u.var).tmp_var,
+ shift_right_function(&EX_T(opline->result.var).tmp_var,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
FREE_OP1();
@@ -121,7 +121,7 @@ ZEND_VM_HANDLER(8, ZEND_CONCAT, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- concat_function(&EX_T(opline->result.u.var).tmp_var,
+ concat_function(&EX_T(opline->result.var).tmp_var,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
FREE_OP1();
@@ -134,7 +134,7 @@ ZEND_VM_HANDLER(15, ZEND_IS_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- is_identical_function(&EX_T(opline->result.u.var).tmp_var,
+ is_identical_function(&EX_T(opline->result.var).tmp_var,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
FREE_OP1();
@@ -146,7 +146,7 @@ ZEND_VM_HANDLER(16, ZEND_IS_NOT_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
{
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
is_identical_function(result,
GET_OP1_ZVAL_PTR(BP_VAR_R),
@@ -161,7 +161,7 @@ ZEND_VM_HANDLER(17, ZEND_IS_EQUAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
{
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
GET_OP1_ZVAL_PTR(BP_VAR_R),
@@ -176,7 +176,7 @@ ZEND_VM_HANDLER(18, ZEND_IS_NOT_EQUAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
{
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
GET_OP1_ZVAL_PTR(BP_VAR_R),
@@ -191,7 +191,7 @@ ZEND_VM_HANDLER(19, ZEND_IS_SMALLER, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
{
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
GET_OP1_ZVAL_PTR(BP_VAR_R),
@@ -206,7 +206,7 @@ ZEND_VM_HANDLER(20, ZEND_IS_SMALLER_OR_EQUAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV
{
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
GET_OP1_ZVAL_PTR(BP_VAR_R),
@@ -222,7 +222,7 @@ ZEND_VM_HANDLER(9, ZEND_BW_OR, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- bitwise_or_function(&EX_T(opline->result.u.var).tmp_var,
+ bitwise_or_function(&EX_T(opline->result.var).tmp_var,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
FREE_OP1();
@@ -235,7 +235,7 @@ ZEND_VM_HANDLER(10, ZEND_BW_AND, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- bitwise_and_function(&EX_T(opline->result.u.var).tmp_var,
+ bitwise_and_function(&EX_T(opline->result.var).tmp_var,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
FREE_OP1();
@@ -248,7 +248,7 @@ ZEND_VM_HANDLER(11, ZEND_BW_XOR, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var,
+ bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
FREE_OP1();
@@ -261,7 +261,7 @@ ZEND_VM_HANDLER(14, ZEND_BOOL_XOR, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- boolean_xor_function(&EX_T(opline->result.u.var).tmp_var,
+ boolean_xor_function(&EX_T(opline->result.var).tmp_var,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
FREE_OP1();
@@ -274,7 +274,7 @@ ZEND_VM_HANDLER(12, ZEND_BW_NOT, CONST|TMP|VAR|CV, ANY)
zend_op *opline = EX(opline);
zend_free_op free_op1;
- bitwise_not_function(&EX_T(opline->result.u.var).tmp_var,
+ bitwise_not_function(&EX_T(opline->result.var).tmp_var,
GET_OP1_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
FREE_OP1();
ZEND_VM_NEXT_OPCODE();
@@ -285,7 +285,7 @@ ZEND_VM_HANDLER(13, ZEND_BOOL_NOT, CONST|TMP|VAR|CV, ANY)
zend_op *opline = EX(opline);
zend_free_op free_op1;
- boolean_not_function(&EX_T(opline->result.u.var).tmp_var,
+ boolean_not_function(&EX_T(opline->result.var).tmp_var,
GET_OP1_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
FREE_OP1();
ZEND_VM_NEXT_OPCODE();
@@ -299,15 +299,15 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR
zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W);
zval *object;
zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R);
- zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R);
- znode *result = &opline->result;
+ zval *value = get_zval_ptr(op_data->op1_type, &op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R);
+ znode_op *result = &opline->result;
int have_get_ptr = 0;
if (OP1_TYPE == IS_VAR && !object_ptr) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- EX_T(result->u.var).var.ptr_ptr = NULL;
+ EX_T(result->var).var.ptr_ptr = NULL;
make_real_object(object_ptr TSRMLS_CC);
object = *object_ptr;
@@ -316,9 +316,9 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR
FREE_OP2();
FREE_OP(free_op_data1);
- if (!RETURN_VALUE_UNUSED(result)) {
- EX_T(result->u.var).var.ptr = EG(uninitialized_zval_ptr);
- EX_T(result->u.var).var.ptr_ptr = NULL;
+ if (RETURN_VALUE_USED(opline)) {
+ EX_T(result->var).var.ptr = EG(uninitialized_zval_ptr);
+ EX_T(result->var).var.ptr_ptr = NULL;
PZVAL_LOCK(EG(uninitialized_zval_ptr));
}
} else {
@@ -330,15 +330,15 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR
/* here property is a string */
if (opline->extended_value == ZEND_ASSIGN_OBJ
&& Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
- zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC);
+ zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (zptr != NULL) { /* NULL means no success in getting PTR */
SEPARATE_ZVAL_IF_NOT_REF(zptr);
have_get_ptr = 1;
binary_op(*zptr, *zptr, value TSRMLS_CC);
- if (!RETURN_VALUE_UNUSED(result)) {
- EX_T(result->u.var).var.ptr = *zptr;
- EX_T(result->u.var).var.ptr_ptr = NULL;
+ if (RETURN_VALUE_USED(opline)) {
+ EX_T(result->var).var.ptr = *zptr;
+ EX_T(result->var).var.ptr_ptr = NULL;
PZVAL_LOCK(*zptr);
}
}
@@ -349,7 +349,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
if (Z_OBJ_HT_P(object)->read_property) {
- z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
+ z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
}
} else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
if (Z_OBJ_HT_P(object)->read_dimension) {
@@ -371,21 +371,21 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR
SEPARATE_ZVAL_IF_NOT_REF(&z);
binary_op(z, z, value TSRMLS_CC);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
- Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, z, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
} else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC);
}
- if (!RETURN_VALUE_UNUSED(result)) {
- EX_T(result->u.var).var.ptr = z;
- EX_T(result->u.var).var.ptr_ptr = NULL;
+ if (RETURN_VALUE_USED(opline)) {
+ EX_T(result->var).var.ptr = z;
+ EX_T(result->var).var.ptr_ptr = NULL;
PZVAL_LOCK(z);
}
zval_ptr_dtor(&z);
} else {
zend_error(E_WARNING, "Attempt to assign property of non-object");
- if (!RETURN_VALUE_UNUSED(result)) {
- EX_T(result->u.var).var.ptr = EG(uninitialized_zval_ptr);
- EX_T(result->u.var).var.ptr_ptr = NULL;
+ if (RETURN_VALUE_USED(opline)) {
+ EX_T(result->var).var.ptr = EG(uninitialized_zval_ptr);
+ EX_T(result->var).var.ptr_ptr = NULL;
PZVAL_LOCK(EG(uninitialized_zval_ptr));
}
}
@@ -430,9 +430,9 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_helper, VAR|UNUSED|CV, CONST|TMP|VAR|UNU
zend_op *op_data = opline+1;
zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R);
- zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), container, dim, IS_OP2_TMP_FREE(), BP_VAR_RW TSRMLS_CC);
- value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R);
- var_ptr = _get_zval_ptr_ptr_var(&op_data->op2, EX(Ts), &free_op_data2 TSRMLS_CC);
+ zend_fetch_dimension_address(&EX_T(op_data->op2.var), container, dim, OP2_TYPE, BP_VAR_RW TSRMLS_CC);
+ value = get_zval_ptr(op_data->op1_type, &op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R);
+ var_ptr = _get_zval_ptr_ptr_var(op_data->op2.var, EX(Ts), &free_op_data2 TSRMLS_CC);
ZEND_VM_INC_OPCODE();
}
}
@@ -449,8 +449,8 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_helper, VAR|UNUSED|CV, CONST|TMP|VAR|UNU
}
if (*var_ptr == EG(error_zval_ptr)) {
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, EG(uninitialized_zval_ptr));
+ if (RETURN_VALUE_USED(opline)) {
+ AI_SET_PTR(EX_T(opline->result.var).var, EG(uninitialized_zval_ptr));
PZVAL_LOCK(EG(uninitialized_zval_ptr));
}
FREE_OP2();
@@ -472,8 +472,8 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_helper, VAR|UNUSED|CV, CONST|TMP|VAR|UNU
binary_op(*var_ptr, *var_ptr, value TSRMLS_CC);
}
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, *var_ptr);
+ if (RETURN_VALUE_USED(opline)) {
+ AI_SET_PTR(EX_T(opline->result.var).var, *var_ptr);
PZVAL_LOCK(*var_ptr);
}
FREE_OP2();
@@ -548,7 +548,7 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR|
zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W);
zval *object;
zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R);
- zval **retval = &EX_T(opline->result.u.var).var.ptr;
+ zval **retval = &EX_T(opline->result.var).var.ptr;
int have_get_ptr = 0;
if (OP1_TYPE == IS_VAR && !object_ptr) {
@@ -561,7 +561,7 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR|
if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
FREE_OP2();
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
+ if (RETURN_VALUE_USED(opline)) {
*retval = EG(uninitialized_zval_ptr);
PZVAL_LOCK(*retval);
}
@@ -576,13 +576,13 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR|
}
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
- zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC);
+ zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (zptr != NULL) { /* NULL means no success in getting PTR */
SEPARATE_ZVAL_IF_NOT_REF(zptr);
have_get_ptr = 1;
incdec_op(*zptr);
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
+ if (RETURN_VALUE_USED(opline)) {
*retval = *zptr;
PZVAL_LOCK(*retval);
}
@@ -591,7 +591,7 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR|
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
- zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -607,12 +607,12 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR|
SEPARATE_ZVAL_IF_NOT_REF(&z);
incdec_op(z);
*retval = z;
- Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC);
- SELECTIVE_PZVAL_LOCK(*retval, &opline->result);
+ Z_OBJ_HT_P(object)->write_property(object, property, z, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
+ SELECTIVE_PZVAL_LOCK(*retval, opline);
zval_ptr_dtor(&z);
} else {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
+ if (RETURN_VALUE_USED(opline)) {
*retval = EG(uninitialized_zval_ptr);
PZVAL_LOCK(*retval);
}
@@ -645,7 +645,7 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR
zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W);
zval *object;
zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R);
- zval *retval = &EX_T(opline->result.u.var).tmp_var;
+ zval *retval = &EX_T(opline->result.var).tmp_var;
int have_get_ptr = 0;
if (OP1_TYPE == IS_VAR && !object_ptr) {
@@ -670,7 +670,7 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR
}
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
- zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC);
+ zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (zptr != NULL) { /* NULL means no success in getting PTR */
have_get_ptr = 1;
SEPARATE_ZVAL_IF_NOT_REF(zptr);
@@ -685,7 +685,7 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
- zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z_copy;
if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
@@ -706,7 +706,7 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR
INIT_PZVAL(z_copy);
incdec_op(z_copy);
Z_ADDREF_P(z);
- Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(&z);
} else {
@@ -744,8 +744,8 @@ ZEND_VM_HANDLER(34, ZEND_PRE_INC, VAR|CV, ANY)
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
if (OP1_TYPE == IS_VAR && *var_ptr == EG(error_zval_ptr)) {
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, EG(uninitialized_zval_ptr));
+ if (RETURN_VALUE_USED(opline)) {
+ AI_SET_PTR(EX_T(opline->result.var).var, EG(uninitialized_zval_ptr));
PZVAL_LOCK(EG(uninitialized_zval_ptr));
}
FREE_OP1_VAR_PTR();
@@ -766,8 +766,8 @@ ZEND_VM_HANDLER(34, ZEND_PRE_INC, VAR|CV, ANY)
increment_function(*var_ptr);
}
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, *var_ptr);
+ if (RETURN_VALUE_USED(opline)) {
+ AI_SET_PTR(EX_T(opline->result.var).var, *var_ptr);
PZVAL_LOCK(*var_ptr);
}
@@ -785,8 +785,8 @@ ZEND_VM_HANDLER(35, ZEND_PRE_DEC, VAR|CV, ANY)
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
if (OP1_TYPE == IS_VAR && *var_ptr == EG(error_zval_ptr)) {
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, EG(uninitialized_zval_ptr));
+ if (RETURN_VALUE_USED(opline)) {
+ AI_SET_PTR(EX_T(opline->result.var).var, EG(uninitialized_zval_ptr));
PZVAL_LOCK(EG(uninitialized_zval_ptr));
}
FREE_OP1_VAR_PTR();
@@ -807,8 +807,8 @@ ZEND_VM_HANDLER(35, ZEND_PRE_DEC, VAR|CV, ANY)
decrement_function(*var_ptr);
}
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, *var_ptr);
+ if (RETURN_VALUE_USED(opline)) {
+ AI_SET_PTR(EX_T(opline->result.var).var, *var_ptr);
PZVAL_LOCK(*var_ptr);
}
@@ -826,15 +826,15 @@ ZEND_VM_HANDLER(36, ZEND_POST_INC, VAR|CV, ANY)
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
if (OP1_TYPE == IS_VAR && *var_ptr == EG(error_zval_ptr)) {
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- EX_T(opline->result.u.var).tmp_var = *EG(uninitialized_zval_ptr);
+ if (RETURN_VALUE_USED(opline)) {
+ EX_T(opline->result.var).tmp_var = *EG(uninitialized_zval_ptr);
}
FREE_OP1_VAR_PTR();
ZEND_VM_NEXT_OPCODE();
}
- EX_T(opline->result.u.var).tmp_var = **var_ptr;
- zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var);
+ EX_T(opline->result.var).tmp_var = **var_ptr;
+ zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var);
SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
@@ -864,15 +864,15 @@ ZEND_VM_HANDLER(37, ZEND_POST_DEC, VAR|CV, ANY)
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
if (OP1_TYPE == IS_VAR && *var_ptr == EG(error_zval_ptr)) {
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- EX_T(opline->result.u.var).tmp_var = *EG(uninitialized_zval_ptr);
+ if (RETURN_VALUE_USED(opline)) {
+ EX_T(opline->result.var).tmp_var = *EG(uninitialized_zval_ptr);
}
FREE_OP1_VAR_PTR();
ZEND_VM_NEXT_OPCODE();
}
- EX_T(opline->result.u.var).tmp_var = **var_ptr;
- zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var);
+ EX_T(opline->result.var).tmp_var = **var_ptr;
+ zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var);
SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
@@ -916,8 +916,8 @@ ZEND_VM_HANDLER(41, ZEND_PRINT, CONST|TMP|VAR|CV, ANY)
{
zend_op *opline = EX(opline);
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1;
- Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG;
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = 1;
+ Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_LONG;
ZEND_VM_DISPATCH_TO_HANDLER(ZEND_ECHO);
}
@@ -930,6 +930,7 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, ANY, int type
zval **retval;
zval tmp_varname;
HashTable *target_symbol_table;
+ ulong hash_value;
if (OP1_TYPE != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
tmp_varname = *varname;
@@ -938,17 +939,23 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, ANY, int type
varname = &tmp_varname;
}
- if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
- retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC);
+ if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC_MEMBER) {
+ retval = zend_std_get_static_property(EX_T(opline->op2.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((OP1_TYPE == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
FREE_OP1();
} else {
- target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
/*
if (!target_symbol_table) {
ZEND_VM_NEXT_OPCODE();
}
*/
- if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &retval) == FAILURE) {
+ if (OP1_TYPE == IS_CONST) {
+ hash_value = Z_HASH_P(varname);
+ } else {
+ hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
+ }
+
+ if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
switch (type) {
case BP_VAR_R:
case BP_VAR_UNSET:
@@ -964,13 +971,13 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, ANY, int type
zval *new_zval = &EG(uninitialized_zval);
Z_ADDREF_P(new_zval);
- zend_hash_update(target_symbol_table, varname->value.str.val, varname->value.str.len+1, &new_zval, sizeof(zval *), (void **) &retval);
+ zend_hash_quick_update(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, &new_zval, sizeof(zval *), (void **) &retval);
}
break;
EMPTY_SWITCH_DEFAULT_CASE()
}
}
- switch (opline->op2.u.EA.type) {
+ switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) {
case ZEND_FETCH_GLOBAL:
if (OP1_TYPE != IS_TMP_VAR) {
FREE_OP1();
@@ -984,7 +991,7 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, ANY, int type
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (OP1_TYPE == IS_VAR && !free_op1.var) {
- PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr);
+ PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
}
break;
}
@@ -994,7 +1001,7 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, ANY, int type
if (OP1_TYPE != IS_CONST && varname == &tmp_varname) {
zval_dtor(varname);
}
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
+ if (RETURN_VALUE_USED(opline)) {
if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
SEPARATE_ZVAL_TO_MAKE_IS_REF(retval);
}
@@ -1002,21 +1009,21 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, ANY, int type
switch (type) {
case BP_VAR_R:
case BP_VAR_IS:
- AI_SET_PTR(EX_T(opline->result.u.var).var, *retval);
+ AI_SET_PTR(EX_T(opline->result.var).var, *retval);
break;
case BP_VAR_UNSET: {
zend_free_op free_res;
- EX_T(opline->result.u.var).var.ptr_ptr = retval;
- PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res);
- if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
- SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr);
+ EX_T(opline->result.var).var.ptr_ptr = retval;
+ PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res);
+ if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
+ SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.var).var.ptr_ptr);
}
- PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr);
+ PZVAL_LOCK(*EX_T(opline->result.var).var.ptr_ptr);
FREE_OP_VAR_PTR(free_res);
break;
default:
- EX_T(opline->result.u.var).var.ptr_ptr = retval;
+ EX_T(opline->result.var).var.ptr_ptr = retval;
break;
}
}
@@ -1042,7 +1049,7 @@ ZEND_VM_HANDLER(86, ZEND_FETCH_RW, CONST|TMP|VAR|CV, ANY)
ZEND_VM_HANDLER(92, ZEND_FETCH_FUNC_ARG, CONST|TMP|VAR|CV, ANY)
{
ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type,
- ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), EX(opline)->extended_value)?BP_VAR_W:BP_VAR_R);
+ ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (EX(opline)->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R);
}
ZEND_VM_HANDLER(95, ZEND_FETCH_UNSET, CONST|TMP|VAR|CV, ANY)
@@ -1062,16 +1069,16 @@ ZEND_VM_HANDLER(81, ZEND_FETCH_DIM_R, VAR|CV, CONST|TMP|VAR|CV)
zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R);
zval **container;
- if (opline->extended_value == ZEND_FETCH_ADD_LOCK &&
+ if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
OP1_TYPE != IS_CV &&
- EX_T(opline->op1.u.var).var.ptr_ptr) {
- PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr);
+ EX_T(opline->op1.var).var.ptr_ptr) {
+ PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
}
container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_R);
if (OP1_TYPE == IS_VAR && !container) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_read(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, IS_OP2_TMP_FREE(), BP_VAR_R TSRMLS_CC);
+ zend_fetch_dimension_address_read(!RETURN_VALUE_USED(opline)?NULL:&EX_T(opline->result.var), container, dim, OP2_TYPE, BP_VAR_R TSRMLS_CC);
FREE_OP2();
FREE_OP1_VAR_PTR();
ZEND_VM_NEXT_OPCODE();
@@ -1087,23 +1094,23 @@ ZEND_VM_HANDLER(84, ZEND_FETCH_DIM_W, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
if (OP1_TYPE == IS_VAR && !container) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address(&EX_T(opline->result.u.var), container, dim, IS_OP2_TMP_FREE(), BP_VAR_W TSRMLS_CC);
+ zend_fetch_dimension_address(&EX_T(opline->result.var), container, dim, OP2_TYPE, BP_VAR_W TSRMLS_CC);
FREE_OP2();
if (OP1_TYPE == IS_VAR && OP1_FREE &&
READY_TO_DESTROY(free_op1.var)) {
- AI_USE_PTR(EX_T(opline->result.u.var).var);
- if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) &&
- Z_REFCOUNT_PP(EX_T(opline->result.u.var).var.ptr_ptr) > 2) {
- SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr);
+ AI_USE_PTR(EX_T(opline->result.var).var);
+ if (!PZVAL_IS_REF(*EX_T(opline->result.var).var.ptr_ptr) &&
+ Z_REFCOUNT_PP(EX_T(opline->result.var).var.ptr_ptr) > 2) {
+ SEPARATE_ZVAL(EX_T(opline->result.var).var.ptr_ptr);
}
}
FREE_OP1_VAR_PTR();
/* We are going to assign the result by reference */
- if (opline->extended_value && EX_T(opline->result.u.var).var.ptr_ptr) {
- Z_DELREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
- SEPARATE_ZVAL_TO_MAKE_IS_REF(EX_T(opline->result.u.var).var.ptr_ptr);
- Z_ADDREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
+ if (opline->extended_value && EX_T(opline->result.var).var.ptr_ptr) {
+ Z_DELREF_PP(EX_T(opline->result.var).var.ptr_ptr);
+ SEPARATE_ZVAL_TO_MAKE_IS_REF(EX_T(opline->result.var).var.ptr_ptr);
+ Z_ADDREF_PP(EX_T(opline->result.var).var.ptr_ptr);
}
ZEND_VM_NEXT_OPCODE();
@@ -1119,14 +1126,14 @@ ZEND_VM_HANDLER(87, ZEND_FETCH_DIM_RW, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
if (OP1_TYPE == IS_VAR && !container) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address(&EX_T(opline->result.u.var), container, dim, IS_OP2_TMP_FREE(), BP_VAR_RW TSRMLS_CC);
+ zend_fetch_dimension_address(&EX_T(opline->result.var), container, dim, OP2_TYPE, BP_VAR_RW TSRMLS_CC);
FREE_OP2();
if (OP1_TYPE == IS_VAR && OP1_FREE &&
READY_TO_DESTROY(free_op1.var)) {
- AI_USE_PTR(EX_T(opline->result.u.var).var);
- if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) &&
- Z_REFCOUNT_PP(EX_T(opline->result.u.var).var.ptr_ptr) > 2) {
- SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr);
+ AI_USE_PTR(EX_T(opline->result.var).var);
+ if (!PZVAL_IS_REF(*EX_T(opline->result.var).var.ptr_ptr) &&
+ Z_REFCOUNT_PP(EX_T(opline->result.var).var.ptr_ptr) > 2) {
+ SEPARATE_ZVAL(EX_T(opline->result.var).var.ptr_ptr);
}
}
FREE_OP1_VAR_PTR();
@@ -1143,7 +1150,7 @@ ZEND_VM_HANDLER(90, ZEND_FETCH_DIM_IS, VAR|CV, CONST|TMP|VAR|CV)
if (OP1_TYPE == IS_VAR && !container) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_read(&EX_T(opline->result.u.var), container, dim, IS_OP2_TMP_FREE(), BP_VAR_IS TSRMLS_CC);
+ zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, dim, OP2_TYPE, BP_VAR_IS TSRMLS_CC);
FREE_OP2();
FREE_OP1_VAR_PTR();
ZEND_VM_NEXT_OPCODE();
@@ -1156,18 +1163,18 @@ ZEND_VM_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R);
zval **container;
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) {
+ if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
if (OP1_TYPE == IS_VAR && !container) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address(&EX_T(opline->result.u.var), container, dim, IS_OP2_TMP_FREE(), BP_VAR_W TSRMLS_CC);
+ zend_fetch_dimension_address(&EX_T(opline->result.var), container, dim, OP2_TYPE, BP_VAR_W TSRMLS_CC);
if (OP1_TYPE == IS_VAR && OP1_FREE &&
READY_TO_DESTROY(free_op1.var)) {
- AI_USE_PTR(EX_T(opline->result.u.var).var);
- if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) &&
- Z_REFCOUNT_PP(EX_T(opline->result.u.var).var.ptr_ptr) > 2) {
- SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr);
+ AI_USE_PTR(EX_T(opline->result.var).var);
+ if (!PZVAL_IS_REF(*EX_T(opline->result.var).var.ptr_ptr) &&
+ Z_REFCOUNT_PP(EX_T(opline->result.var).var.ptr_ptr) > 2) {
+ SEPARATE_ZVAL(EX_T(opline->result.var).var.ptr_ptr);
}
}
} else {
@@ -1178,7 +1185,7 @@ ZEND_VM_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
if (OP1_TYPE == IS_VAR && !container) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_read(&EX_T(opline->result.u.var), container, dim, IS_OP2_TMP_FREE(), BP_VAR_R TSRMLS_CC);
+ zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, dim, OP2_TYPE, BP_VAR_R TSRMLS_CC);
}
FREE_OP2();
FREE_OP1_VAR_PTR();
@@ -1193,8 +1200,8 @@ ZEND_VM_HANDLER(96, ZEND_FETCH_DIM_UNSET, VAR|CV, CONST|TMP|VAR|CV)
zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R);
/* Not needed in DIM_UNSET
- if (opline->extended_value == ZEND_FETCH_ADD_LOCK) {
- PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr);
+ if (opline->extended_value & ZEND_FETCH_ADD_LOCK) {
+ PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
}
*/
if (OP1_TYPE == IS_CV) {
@@ -1205,27 +1212,27 @@ ZEND_VM_HANDLER(96, ZEND_FETCH_DIM_UNSET, VAR|CV, CONST|TMP|VAR|CV)
if (OP1_TYPE == IS_VAR && !container) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address(&EX_T(opline->result.u.var), container, dim, IS_OP2_TMP_FREE(), BP_VAR_UNSET TSRMLS_CC);
+ zend_fetch_dimension_address(&EX_T(opline->result.var), container, dim, OP2_TYPE, BP_VAR_UNSET TSRMLS_CC);
FREE_OP2();
if (OP1_TYPE == IS_VAR && OP1_FREE &&
READY_TO_DESTROY(free_op1.var)) {
- AI_USE_PTR(EX_T(opline->result.u.var).var);
- if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) &&
- Z_REFCOUNT_PP(EX_T(opline->result.u.var).var.ptr_ptr) > 2) {
- SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr);
+ AI_USE_PTR(EX_T(opline->result.var).var);
+ if (!PZVAL_IS_REF(*EX_T(opline->result.var).var.ptr_ptr) &&
+ Z_REFCOUNT_PP(EX_T(opline->result.var).var.ptr_ptr) > 2) {
+ SEPARATE_ZVAL(EX_T(opline->result.var).var.ptr_ptr);
}
}
FREE_OP1_VAR_PTR();
- if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) {
+ if (EX_T(opline->result.var).var.ptr_ptr == NULL) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
} else {
zend_free_op free_res;
- PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res);
- if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
- SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr);
+ PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res);
+ if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
+ SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.var).var.ptr_ptr);
}
- PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr);
+ PZVAL_LOCK(*EX_T(opline->result.var).var.ptr_ptr);
FREE_OP_VAR_PTR(free_res);
}
ZEND_VM_NEXT_OPCODE();
@@ -1243,8 +1250,8 @@ ZEND_VM_HELPER_EX(zend_fetch_property_address_read_helper, VAR|UNUSED|CV, CONST|
if (type != BP_VAR_IS) {
zend_error(E_NOTICE, "Trying to get property of non-object");
}
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, EG(uninitialized_zval_ptr));
+ if (RETURN_VALUE_USED(opline)) {
+ AI_SET_PTR(EX_T(opline->result.var).var, EG(uninitialized_zval_ptr));
PZVAL_LOCK(EG(uninitialized_zval_ptr));
}
FREE_OP2();
@@ -1256,16 +1263,16 @@ ZEND_VM_HELPER_EX(zend_fetch_property_address_read_helper, VAR|UNUSED|CV, CONST|
}
/* here we are sure we are dealing with an object */
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, type, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
- if (RETURN_VALUE_UNUSED(&opline->result)) {
+ if (!RETURN_VALUE_USED(opline)) {
if (Z_REFCOUNT_P(retval) == 0) {
GC_REMOVE_ZVAL_FROM_BUFFER(retval);
zval_dtor(retval);
FREE_ZVAL(retval);
}
} else {
- AI_SET_PTR(EX_T(opline->result.u.var).var, retval);
+ AI_SET_PTR(EX_T(opline->result.var).var, retval);
PZVAL_LOCK(retval);
}
@@ -1293,8 +1300,8 @@ ZEND_VM_HANDLER(85, ZEND_FETCH_OBJ_W, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
zval **container;
if (OP1_TYPE == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
- PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr);
- EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr;
+ PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
+ EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr;
}
if (IS_OP2_TMP_FREE()) {
@@ -1304,7 +1311,7 @@ ZEND_VM_HANDLER(85, ZEND_FETCH_OBJ_W, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
if (OP1_TYPE == IS_VAR && !container) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(&EX_T(opline->result.u.var), container, property, BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
if (IS_OP2_TMP_FREE()) {
zval_ptr_dtor(&property);
} else {
@@ -1312,19 +1319,19 @@ ZEND_VM_HANDLER(85, ZEND_FETCH_OBJ_W, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
}
if (OP1_TYPE == IS_VAR && OP1_FREE &&
READY_TO_DESTROY(free_op1.var)) {
- AI_USE_PTR(EX_T(opline->result.u.var).var);
- if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) &&
- Z_REFCOUNT_PP(EX_T(opline->result.u.var).var.ptr_ptr) > 2) {
- SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr);
+ AI_USE_PTR(EX_T(opline->result.var).var);
+ if (!PZVAL_IS_REF(*EX_T(opline->result.var).var.ptr_ptr) &&
+ Z_REFCOUNT_PP(EX_T(opline->result.var).var.ptr_ptr) > 2) {
+ SEPARATE_ZVAL(EX_T(opline->result.var).var.ptr_ptr);
}
}
FREE_OP1_VAR_PTR();
/* We are going to assign the result by reference */
if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
- Z_DELREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
- SEPARATE_ZVAL_TO_MAKE_IS_REF(EX_T(opline->result.u.var).var.ptr_ptr);
- Z_ADDREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
+ Z_DELREF_PP(EX_T(opline->result.var).var.ptr_ptr);
+ SEPARATE_ZVAL_TO_MAKE_IS_REF(EX_T(opline->result.var).var.ptr_ptr);
+ Z_ADDREF_PP(EX_T(opline->result.var).var.ptr_ptr);
}
ZEND_VM_NEXT_OPCODE();
@@ -1343,7 +1350,7 @@ ZEND_VM_HANDLER(88, ZEND_FETCH_OBJ_RW, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
if (OP1_TYPE == IS_VAR && !container) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(&EX_T(opline->result.u.var), container, property, BP_VAR_RW TSRMLS_CC);
+ zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_RW TSRMLS_CC);
if (IS_OP2_TMP_FREE()) {
zval_ptr_dtor(&property);
} else {
@@ -1351,10 +1358,10 @@ ZEND_VM_HANDLER(88, ZEND_FETCH_OBJ_RW, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
}
if (OP1_TYPE == IS_VAR && OP1_FREE &&
READY_TO_DESTROY(free_op1.var)) {
- AI_USE_PTR(EX_T(opline->result.u.var).var);
- if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) &&
- Z_REFCOUNT_PP(EX_T(opline->result.u.var).var.ptr_ptr) > 2) {
- SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr);
+ AI_USE_PTR(EX_T(opline->result.var).var);
+ if (!PZVAL_IS_REF(*EX_T(opline->result.var).var.ptr_ptr) &&
+ Z_REFCOUNT_PP(EX_T(opline->result.var).var.ptr_ptr) > 2) {
+ SEPARATE_ZVAL(EX_T(opline->result.var).var.ptr_ptr);
}
}
FREE_OP1_VAR_PTR();
@@ -1370,7 +1377,7 @@ ZEND_VM_HANDLER(94, ZEND_FETCH_OBJ_FUNC_ARG, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
{
zend_op *opline = EX(opline);
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) {
+ if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1, free_op2;
zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R);
@@ -1382,7 +1389,7 @@ ZEND_VM_HANDLER(94, ZEND_FETCH_OBJ_FUNC_ARG, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
if (OP1_TYPE == IS_VAR && !container) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(&EX_T(opline->result.u.var), container, property, BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
if (IS_OP2_TMP_FREE()) {
zval_ptr_dtor(&property);
} else {
@@ -1390,10 +1397,10 @@ ZEND_VM_HANDLER(94, ZEND_FETCH_OBJ_FUNC_ARG, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
}
if (OP1_TYPE == IS_VAR && OP1_FREE &&
READY_TO_DESTROY(free_op1.var)) {
- AI_USE_PTR(EX_T(opline->result.u.var).var);
- if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) &&
- Z_REFCOUNT_PP(EX_T(opline->result.u.var).var.ptr_ptr) > 2) {
- SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr);
+ AI_USE_PTR(EX_T(opline->result.var).var);
+ if (!PZVAL_IS_REF(*EX_T(opline->result.var).var.ptr_ptr) &&
+ Z_REFCOUNT_PP(EX_T(opline->result.var).var.ptr_ptr) > 2) {
+ SEPARATE_ZVAL(EX_T(opline->result.var).var.ptr_ptr);
}
}
FREE_OP1_VAR_PTR();
@@ -1421,7 +1428,7 @@ ZEND_VM_HANDLER(97, ZEND_FETCH_OBJ_UNSET, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
if (OP1_TYPE == IS_VAR && !container) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(&EX_T(opline->result.u.var), container, property, BP_VAR_UNSET TSRMLS_CC);
+ zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_UNSET TSRMLS_CC);
if (IS_OP2_TMP_FREE()) {
zval_ptr_dtor(&property);
} else {
@@ -1429,19 +1436,19 @@ ZEND_VM_HANDLER(97, ZEND_FETCH_OBJ_UNSET, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
}
if (OP1_TYPE == IS_VAR && OP1_FREE &&
READY_TO_DESTROY(free_op1.var)) {
- AI_USE_PTR(EX_T(opline->result.u.var).var);
- if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) &&
- Z_REFCOUNT_PP(EX_T(opline->result.u.var).var.ptr_ptr) > 2) {
- SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr);
+ AI_USE_PTR(EX_T(opline->result.var).var);
+ if (!PZVAL_IS_REF(*EX_T(opline->result.var).var.ptr_ptr) &&
+ Z_REFCOUNT_PP(EX_T(opline->result.var).var.ptr_ptr) > 2) {
+ SEPARATE_ZVAL(EX_T(opline->result.var).var.ptr_ptr);
}
}
FREE_OP1_VAR_PTR();
- PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res);
- if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
- SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr);
+ PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res);
+ if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
+ SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.var).var.ptr_ptr);
}
- PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr);
+ PZVAL_LOCK(*EX_T(opline->result.var).var.ptr_ptr);
FREE_OP_VAR_PTR(free_res);
ZEND_VM_NEXT_OPCODE();
}
@@ -1453,16 +1460,16 @@ ZEND_VM_HANDLER(98, ZEND_FETCH_DIM_TMP_VAR, CONST|TMP, CONST)
zval *container = GET_OP1_ZVAL_PTR(BP_VAR_R);
if (Z_TYPE_P(container) != IS_ARRAY) {
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, EG(uninitialized_zval_ptr));
+ if (RETURN_VALUE_USED(opline)) {
+ AI_SET_PTR(EX_T(opline->result.var).var, EG(uninitialized_zval_ptr));
PZVAL_LOCK(EG(uninitialized_zval_ptr));
}
} else {
zend_free_op free_op2;
zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R);
- AI_SET_PTR(EX_T(opline->result.u.var).var, *zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, BP_VAR_R TSRMLS_CC));
- SELECTIVE_PZVAL_LOCK(EX_T(opline->result.u.var).var.ptr, &opline->result);
+ AI_SET_PTR(EX_T(opline->result.var).var, *zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, OP2_TYPE, BP_VAR_R TSRMLS_CC));
+ SELECTIVE_PZVAL_LOCK(EX_T(opline->result.var).var.ptr, opline);
FREE_OP2();
}
ZEND_VM_NEXT_OPCODE();
@@ -1482,7 +1489,7 @@ ZEND_VM_HANDLER(136, ZEND_ASSIGN_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
if (OP1_TYPE == IS_VAR && !object_ptr) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_assign_to_object(&opline->result, object_ptr, property_name, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, op_data->op1_type, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (IS_OP2_TMP_FREE()) {
zval_ptr_dtor(&property_name);
} else {
@@ -1511,7 +1518,7 @@ ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
if (IS_OP2_TMP_FREE()) {
MAKE_REAL_ZVAL_PTR(property_name);
}
- zend_assign_to_object(&opline->result, object_ptr, property_name, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, op_data->op1_type, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (IS_OP2_TMP_FREE()) {
zval_ptr_dtor(&property_name);
} else {
@@ -1523,27 +1530,27 @@ ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R);
zval **variable_ptr_ptr;
- zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, IS_OP2_TMP_FREE(), BP_VAR_W TSRMLS_CC);
+ zend_fetch_dimension_address(&EX_T(op_data->op2.var), object_ptr, dim, OP2_TYPE, BP_VAR_W TSRMLS_CC);
FREE_OP2();
- value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R);
- variable_ptr_ptr = _get_zval_ptr_ptr_var(&op_data->op2, EX(Ts), &free_op_data2 TSRMLS_CC);
+ value = get_zval_ptr(op_data->op1_type, &op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R);
+ variable_ptr_ptr = _get_zval_ptr_ptr_var(op_data->op2.var, EX(Ts), &free_op_data2 TSRMLS_CC);
if (!variable_ptr_ptr) {
- if (zend_assign_to_string_offset(&EX_T(op_data->op2.u.var), value, op_data->op1.op_type TSRMLS_CC)) {
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
- ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
- INIT_PZVAL(EX_T(opline->result.u.var).var.ptr);
- ZVAL_STRINGL(EX_T(opline->result.u.var).var.ptr, Z_STRVAL_P(EX_T(op_data->op2.u.var).str_offset.str)+EX_T(op_data->op2.u.var).str_offset.offset, 1, 1);
+ if (zend_assign_to_string_offset(&EX_T(op_data->op2.var), value, op_data->op1_type TSRMLS_CC)) {
+ if (RETURN_VALUE_USED(opline)) {
+ EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
+ ALLOC_ZVAL(EX_T(opline->result.var).var.ptr);
+ INIT_PZVAL(EX_T(opline->result.var).var.ptr);
+ ZVAL_STRINGL(EX_T(opline->result.var).var.ptr, Z_STRVAL_P(EX_T(op_data->op2.var).str_offset.str)+EX_T(op_data->op2.var).str_offset.offset, 1, 1);
}
- } else if (!RETURN_VALUE_UNUSED(&opline->result)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, EG(uninitialized_zval_ptr));
+ } else if (RETURN_VALUE_USED(opline)) {
+ AI_SET_PTR(EX_T(opline->result.var).var, EG(uninitialized_zval_ptr));
PZVAL_LOCK(EG(uninitialized_zval_ptr));
}
} else {
value = zend_assign_to_variable(variable_ptr_ptr, value, IS_TMP_FREE(free_op_data1) TSRMLS_CC);
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, value);
+ if (RETURN_VALUE_USED(opline)) {
+ AI_SET_PTR(EX_T(opline->result.var).var, value);
PZVAL_LOCK(value);
}
}
@@ -1564,21 +1571,21 @@ ZEND_VM_HANDLER(38, ZEND_ASSIGN, VAR|CV, CONST|TMP|VAR|CV)
zval **variable_ptr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
if (OP1_TYPE == IS_VAR && !variable_ptr_ptr) {
- if (zend_assign_to_string_offset(&EX_T(opline->op1.u.var), value, OP2_TYPE TSRMLS_CC)) {
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
- ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
- INIT_PZVAL(EX_T(opline->result.u.var).var.ptr);
- ZVAL_STRINGL(EX_T(opline->result.u.var).var.ptr, Z_STRVAL_P(EX_T(opline->op1.u.var).str_offset.str)+EX_T(opline->op1.u.var).str_offset.offset, 1, 1);
+ if (zend_assign_to_string_offset(&EX_T(opline->op1.var), value, OP2_TYPE TSRMLS_CC)) {
+ if (RETURN_VALUE_USED(opline)) {
+ EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
+ ALLOC_ZVAL(EX_T(opline->result.var).var.ptr);
+ INIT_PZVAL(EX_T(opline->result.var).var.ptr);
+ ZVAL_STRINGL(EX_T(opline->result.var).var.ptr, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1);
}
- } else if (!RETURN_VALUE_UNUSED(&opline->result)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, EG(uninitialized_zval_ptr));
+ } else if (RETURN_VALUE_USED(opline)) {
+ AI_SET_PTR(EX_T(opline->result.var).var, EG(uninitialized_zval_ptr));
PZVAL_LOCK(EG(uninitialized_zval_ptr));
}
} else {
value = zend_assign_to_variable(variable_ptr_ptr, value, IS_OP2_TMP_FREE() TSRMLS_CC);
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, value);
+ if (RETURN_VALUE_USED(opline)) {
+ AI_SET_PTR(EX_T(opline->result.var).var, value);
PZVAL_LOCK(value);
}
}
@@ -1602,7 +1609,7 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV)
value_ptr_ptr &&
!Z_ISREF_PP(value_ptr_ptr) &&
opline->extended_value == ZEND_RETURNS_FUNCTION &&
- !EX_T(opline->op2.u.var).var.fcall_returned_reference) {
+ !EX_T(opline->op2.var).var.fcall_returned_reference) {
if (free_op2.var == NULL) {
PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
}
@@ -1615,7 +1622,7 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV)
} else if (OP2_TYPE == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
PZVAL_LOCK(*value_ptr_ptr);
}
- if (OP1_TYPE == IS_VAR && EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) {
+ if (OP1_TYPE == IS_VAR && EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) {
zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object");
}
@@ -1630,8 +1637,8 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV)
Z_DELREF_PP(variable_ptr_ptr);
}
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, *variable_ptr_ptr);
+ if (RETURN_VALUE_USED(opline)) {
+ AI_SET_PTR(EX_T(opline->result.var).var, *variable_ptr_ptr);
PZVAL_LOCK(*variable_ptr_ptr);
}
@@ -1644,9 +1651,9 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV)
ZEND_VM_HANDLER(42, ZEND_JMP, ANY, ANY)
{
#if DEBUG_ZEND>=2
- printf("Jumping to %d\n", EX(opline)->op1.u.opline_num);
+ printf("Jumping to %d\n", EX(opline)->op1.opline_num);
#endif
- ZEND_VM_SET_OPCODE(EX(opline)->op1.u.jmp_addr);
+ ZEND_VM_SET_OPCODE(EX(opline)->op1.jmp_addr);
ZEND_VM_CONTINUE(); /* CHECK_ME */
}
@@ -1668,9 +1675,9 @@ ZEND_VM_HANDLER(43, ZEND_JMPZ, CONST|TMP|VAR|CV, ANY)
}
if (!ret) {
#if DEBUG_ZEND>=2
- printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
+ printf("Conditional jmp to %d\n", opline->op2.opline_num);
#endif
- ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr);
+ ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
ZEND_VM_CONTINUE();
}
@@ -1695,9 +1702,9 @@ ZEND_VM_HANDLER(44, ZEND_JMPNZ, CONST|TMP|VAR|CV, ANY)
}
if (ret) {
#if DEBUG_ZEND>=2
- printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
+ printf("Conditional jmp to %d\n", opline->op2.opline_num);
#endif
- ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr);
+ ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
ZEND_VM_CONTINUE();
}
@@ -1728,9 +1735,9 @@ ZEND_VM_HANDLER(45, ZEND_JMPZNZ, CONST|TMP|VAR|CV, ANY)
ZEND_VM_CONTINUE(); /* CHECK_ME */
} else {
#if DEBUG_ZEND>=2
- printf("Conditional jmp on false to %d\n", opline->op2.u.opline_num);
+ printf("Conditional jmp on false to %d\n", opline->op2.opline_num);
#endif
- ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.u.opline_num]);
+ ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]);
ZEND_VM_CONTINUE(); /* CHECK_ME */
}
}
@@ -1751,13 +1758,13 @@ ZEND_VM_HANDLER(46, ZEND_JMPZ_EX, CONST|TMP|VAR|CV, ANY)
ZEND_VM_CONTINUE();
}
}
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval;
- Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = retval;
+ Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
if (!retval) {
#if DEBUG_ZEND>=2
- printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
+ printf("Conditional jmp to %d\n", opline->op2.opline_num);
#endif
- ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr);
+ ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
ZEND_VM_CONTINUE();
}
ZEND_VM_NEXT_OPCODE();
@@ -1779,13 +1786,13 @@ ZEND_VM_HANDLER(47, ZEND_JMPNZ_EX, CONST|TMP|VAR|CV, ANY)
ZEND_VM_CONTINUE();
}
}
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval;
- Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = retval;
+ Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
if (retval) {
#if DEBUG_ZEND>=2
- printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
+ printf("Conditional jmp to %d\n", opline->op2.opline_num);
#endif
- ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr);
+ ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
ZEND_VM_CONTINUE();
}
ZEND_VM_NEXT_OPCODE();
@@ -1793,13 +1800,13 @@ ZEND_VM_HANDLER(47, ZEND_JMPNZ_EX, CONST|TMP|VAR|CV, ANY)
ZEND_VM_HANDLER(70, ZEND_FREE, TMP, ANY)
{
- zendi_zval_dtor(EX_T(EX(opline)->op1.u.var).tmp_var);
+ zendi_zval_dtor(EX_T(EX(opline)->op1.var).tmp_var);
ZEND_VM_NEXT_OPCODE();
}
ZEND_VM_HANDLER(53, ZEND_INIT_STRING, ANY, ANY)
{
- zval *tmp = &EX_T(EX(opline)->result.u.var).tmp_var;
+ zval *tmp = &EX_T(EX(opline)->result.var).tmp_var;
tmp->value.str.val = emalloc(1);
tmp->value.str.val[0] = 0;
@@ -1813,7 +1820,7 @@ ZEND_VM_HANDLER(53, ZEND_INIT_STRING, ANY, ANY)
ZEND_VM_HANDLER(54, ZEND_ADD_CHAR, TMP|UNUSED, CONST)
{
zend_op *opline = EX(opline);
- zval *str = &EX_T(opline->result.u.var).tmp_var;
+ zval *str = &EX_T(opline->result.var).tmp_var;
if (OP1_TYPE == IS_UNUSED) {
/* Initialize for erealloc in add_char_to_string */
@@ -1824,7 +1831,7 @@ ZEND_VM_HANDLER(54, ZEND_ADD_CHAR, TMP|UNUSED, CONST)
INIT_PZVAL(str);
}
- add_char_to_string(str, str, &opline->op2.u.constant);
+ add_char_to_string(str, str, opline->op2.zv);
/* FREE_OP is missing intentionally here - we're always working on the same temporary variable */
ZEND_VM_NEXT_OPCODE();
@@ -1833,7 +1840,7 @@ ZEND_VM_HANDLER(54, ZEND_ADD_CHAR, TMP|UNUSED, CONST)
ZEND_VM_HANDLER(55, ZEND_ADD_STRING, TMP|UNUSED, CONST)
{
zend_op *opline = EX(opline);
- zval *str = &EX_T(opline->result.u.var).tmp_var;
+ zval *str = &EX_T(opline->result.var).tmp_var;
if (OP1_TYPE == IS_UNUSED) {
/* Initialize for erealloc in add_string_to_string */
@@ -1844,7 +1851,7 @@ ZEND_VM_HANDLER(55, ZEND_ADD_STRING, TMP|UNUSED, CONST)
INIT_PZVAL(str);
}
- add_string_to_string(str, str, &opline->op2.u.constant);
+ add_string_to_string(str, str, opline->op2.zv);
/* FREE_OP is missing intentionally here - we're always working on the same temporary variable */
ZEND_VM_NEXT_OPCODE();
@@ -1854,7 +1861,7 @@ ZEND_VM_HANDLER(56, ZEND_ADD_VAR, TMP|UNUSED, TMP|VAR|CV)
{
zend_op *opline = EX(opline);
zend_free_op free_op2;
- zval *str = &EX_T(opline->result.u.var).tmp_var;
+ zval *str = &EX_T(opline->result.var).tmp_var;
zval *var = GET_OP2_ZVAL_PTR(BP_VAR_R);
zval var_copy;
int use_copy = 0;
@@ -1897,16 +1904,18 @@ ZEND_VM_HANDLER(109, ZEND_FETCH_CLASS, ANY, CONST|TMP|VAR|UNUSED|CV)
if (OP2_TYPE == IS_UNUSED) {
- EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC);
+ EX_T(opline->result.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
} else {
zend_free_op free_op2;
zval *class_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
- if (OP2_TYPE != IS_CONST && Z_TYPE_P(class_name) == IS_OBJECT) {
- EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name);
+ if (OP2_TYPE == IS_CONST) {
+ EX_T(opline->result.var).class_entry = zend_fetch_class_by_name(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->op2.literal + 1, opline->extended_value TSRMLS_CC);
+ } else if (Z_TYPE_P(class_name) == IS_OBJECT) {
+ EX_T(opline->result.var).class_entry = Z_OBJCE_P(class_name);
} else if (Z_TYPE_P(class_name) == IS_STRING) {
- EX_T(opline->result.u.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC);
+ EX_T(opline->result.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC);
} else {
zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string");
}
@@ -1943,7 +1952,7 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, TMP|VAR|UNUSED|CV, CONST|TMP|VAR|CV)
}
/* First, locate the function. */
- EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC);
+ EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((OP2_TYPE == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
if (!EX(fbc)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval);
}
@@ -1983,15 +1992,15 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS
if (OP1_TYPE == IS_CONST) {
/* no function found. try a static method in class */
- ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
if (!ce) {
- zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL(opline->op1.u.constant));
+ zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
}
EX(called_scope) = ce;
} else {
- ce = EX_T(opline->op1.u.var).class_entry;
+ ce = EX_T(opline->op1.var).class_entry;
- if (opline->op1.u.EA.type == ZEND_FETCH_CLASS_PARENT || opline->op1.u.EA.type == ZEND_FETCH_CLASS_SELF) {
+ if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) {
EX(called_scope) = EG(called_scope);
} else {
EX(called_scope) = ce;
@@ -2003,8 +2012,8 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS
zend_free_op free_op2;
if (OP2_TYPE == IS_CONST) {
- function_name_strval = Z_STRVAL(opline->op2.u.constant);
- function_name_strlen = Z_STRLEN(opline->op2.u.constant);
+ function_name_strval = Z_STRVAL_P(opline->op2.zv);
+ function_name_strlen = Z_STRLEN_P(opline->op2.zv);
} else {
function_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
@@ -2020,7 +2029,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS
if (ce->get_static_method) {
EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
} else {
- EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+ EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((OP2_TYPE == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
}
if (!EX(fbc)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval);
@@ -2081,8 +2090,8 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
if (OP2_TYPE == IS_CONST) {
- if (zend_hash_quick_find(EG(function_table), Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant)+1, opline->extended_value, (void **) &EX(fbc)) == FAILURE) {
- zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL(opline->op2.u.constant));
+ if (zend_hash_quick_find(EG(function_table), Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv)+1, Z_HASH_P(opline->op1.zv), (void **) &EX(fbc)) == FAILURE) {
+ zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(opline->op2.zv));
}
} else {
function_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
@@ -2130,10 +2139,10 @@ ZEND_VM_HANDLER(69, ZEND_INIT_NS_FCALL_BY_NAME, ANY, CONST)
ZEND_VM_INC_OPCODE();
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
- if (zend_hash_quick_find(EG(function_table), Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant)+1, opline->extended_value, (void **) &EX(fbc))==FAILURE) {
- char *short_name = Z_STRVAL(opline->op1.u.constant)+Z_LVAL(op_data->op1.u.constant);
- if (zend_hash_quick_find(EG(function_table), short_name, Z_STRLEN(opline->op1.u.constant)-Z_LVAL(op_data->op1.u.constant)+1, op_data->extended_value, (void **) &EX(fbc))==FAILURE) {
- zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL(opline->op2.u.constant));
+ if (zend_hash_quick_find(EG(function_table), Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv)+1, Z_HASH_P(opline->op1.zv), (void **) &EX(fbc))==FAILURE) {
+ char *short_name = Z_STRVAL_P(opline->op1.zv)+op_data->op1.num;
+ if (zend_hash_quick_find(EG(function_table), short_name, Z_STRLEN_P(opline->op1.zv)-op_data->op1.num+1, op_data->extended_value, (void **) &EX(fbc))==FAILURE) {
+ zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(opline->op2.zv));
}
}
@@ -2173,11 +2182,11 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
EX(object) = EX(current_object);
if (RETURN_VALUE_USED(EX(call_opline))) {
- if (!EX_T(EX(call_opline)->result.u.var).var.ptr) { /* there was no return statement */
- ALLOC_ZVAL(EX_T(EX(call_opline)->result.u.var).var.ptr);
- INIT_PZVAL(EX_T(EX(call_opline)->result.u.var).var.ptr);
- Z_LVAL_P(EX_T(EX(call_opline)->result.u.var).var.ptr) = 1;
- Z_TYPE_P(EX_T(EX(call_opline)->result.u.var).var.ptr) = IS_BOOL;
+ if (!EX_T(EX(call_opline)->result.var).var.ptr) { /* there was no return statement */
+ ALLOC_ZVAL(EX_T(EX(call_opline)->result.var).var.ptr);
+ INIT_PZVAL(EX_T(EX(call_opline)->result.var).var.ptr);
+ Z_LVAL_P(EX_T(EX(call_opline)->result.var).var.ptr) = 1;
+ Z_TYPE_P(EX_T(EX(call_opline)->result.var).var.ptr) = IS_BOOL;
}
}
@@ -2235,8 +2244,8 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
if (EG(exception)) {
zend_throw_exception_internal(NULL TSRMLS_CC);
- if (RETURN_VALUE_USED(EX(call_opline)) && EX_T(EX(call_opline)->result.u.var).var.ptr) {
- zval_ptr_dtor(&EX_T(EX(call_opline)->result.u.var).var.ptr);
+ if (RETURN_VALUE_USED(EX(call_opline)) && EX_T(EX(call_opline)->result.var).var.ptr) {
+ zval_ptr_dtor(&EX_T(EX(call_opline)->result.var).var.ptr);
}
}
@@ -2293,9 +2302,9 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
EX(function_state).arguments = zend_vm_stack_push_args(opline->extended_value TSRMLS_CC);
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) {
- ALLOC_INIT_ZVAL(EX_T(opline->result.u.var).var.ptr);
- EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
- EX_T(opline->result.u.var).var.fcall_returned_reference = EX(function_state).function->common.return_reference;
+ ALLOC_INIT_ZVAL(EX_T(opline->result.var).var.ptr);
+ EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
+ EX_T(opline->result.var).var.fcall_returned_reference = EX(function_state).function->common.return_reference;
if (EX(function_state).function->common.arg_info) {
zend_uint i=0;
@@ -2309,13 +2318,13 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
}
if (!zend_execute_internal) {
/* saves one function call if zend_execute_internal is not used */
- ((zend_internal_function *) EX(function_state).function)->handler(opline->extended_value, EX_T(opline->result.u.var).var.ptr, EX(function_state).function->common.return_reference?&EX_T(opline->result.u.var).var.ptr:NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
+ ((zend_internal_function *) EX(function_state).function)->handler(opline->extended_value, EX_T(opline->result.var).var.ptr, EX(function_state).function->common.return_reference?&EX_T(opline->result.var).var.ptr:NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
} else {
zend_execute_internal(EXECUTE_DATA, RETURN_VALUE_USED(opline) TSRMLS_CC);
}
if (!RETURN_VALUE_USED(opline)) {
- zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
+ zval_ptr_dtor(&EX_T(opline->result.var).var.ptr);
}
} else if (EX(function_state).function->type == ZEND_USER_FUNCTION) {
EX(original_return_value) = EG(return_value_ptr_ptr);
@@ -2323,10 +2332,10 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
EG(active_op_array) = &EX(function_state).function->op_array;
EG(return_value_ptr_ptr) = NULL;
if (RETURN_VALUE_USED(opline)) {
- EG(return_value_ptr_ptr) = &EX_T(opline->result.u.var).var.ptr;
- EX_T(opline->result.u.var).var.ptr = NULL;
- EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
- EX_T(opline->result.u.var).var.fcall_returned_reference = EX(function_state).function->common.return_reference;
+ EG(return_value_ptr_ptr) = &EX_T(opline->result.var).var.ptr;
+ EX_T(opline->result.var).var.ptr = NULL;
+ EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
+ EX_T(opline->result.var).var.fcall_returned_reference = EX(function_state).function->common.return_reference;
}
if (zend_execute == execute && !EG(exception)) {
@@ -2352,11 +2361,11 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
}
EG(active_symbol_table) = EX(symbol_table);
} else { /* ZEND_OVERLOADED_FUNCTION */
- ALLOC_INIT_ZVAL(EX_T(opline->result.u.var).var.ptr);
+ ALLOC_INIT_ZVAL(EX_T(opline->result.var).var.ptr);
/* Not sure what should be done here if it's a static method */
if (EX(object)) {
- Z_OBJ_HT_P(EX(object))->call_method(EX(function_state).function->common.function_name, opline->extended_value, EX_T(opline->result.u.var).var.ptr, &EX_T(opline->result.u.var).var.ptr, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
+ Z_OBJ_HT_P(EX(object))->call_method(EX(function_state).function->common.function_name, opline->extended_value, EX_T(opline->result.var).var.ptr, &EX_T(opline->result.var).var.ptr, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
} else {
zend_error_noreturn(E_ERROR, "Cannot call overloaded function for non-object");
}
@@ -2367,12 +2376,12 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
efree(EX(function_state).function);
if (!RETURN_VALUE_USED(opline)) {
- zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
+ zval_ptr_dtor(&EX_T(opline->result.var).var.ptr);
} else {
- Z_UNSET_ISREF_P(EX_T(opline->result.u.var).var.ptr);
- Z_SET_REFCOUNT_P(EX_T(opline->result.u.var).var.ptr, 1);
- EX_T(opline->result.u.var).var.fcall_returned_reference = 0;
- EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
+ Z_UNSET_ISREF_P(EX_T(opline->result.var).var.ptr);
+ Z_SET_REFCOUNT_P(EX_T(opline->result.var).var.ptr, 1);
+ EX_T(opline->result.var).var.fcall_returned_reference = 0;
+ EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
}
}
@@ -2403,8 +2412,8 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
if (EG(exception)) {
zend_throw_exception_internal(NULL TSRMLS_CC);
- if (RETURN_VALUE_USED(opline) && EX_T(opline->result.u.var).var.ptr) {
- zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
+ if (RETURN_VALUE_USED(opline) && EX_T(opline->result.var).var.ptr) {
+ zval_ptr_dtor(&EX_T(opline->result.var).var.ptr);
}
}
@@ -2425,7 +2434,7 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, CONST, ANY)
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
- if (zend_hash_quick_find(EG(function_table), fname->value.str.val, fname->value.str.len+1, Z_LVAL(opline->op2.u.constant), (void **) &EX(function_state).function)==FAILURE) {
+ if (zend_hash_quick_find(EG(function_table), Z_STRVAL_P(fname), Z_STRLEN_P(fname)+1, Z_HASH_P(fname), (void **) &EX(function_state).function)==FAILURE) {
zend_error_noreturn(E_ERROR, "Call to undefined function %s()", fname->value.str.val);
}
EX(object) = NULL;
@@ -2458,8 +2467,8 @@ ZEND_VM_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY)
if (OP1_TYPE == IS_VAR && !Z_ISREF_PP(retval_ptr_ptr)) {
if (opline->extended_value == ZEND_RETURNS_FUNCTION &&
- EX_T(opline->op1.u.var).var.fcall_returned_reference) {
- } else if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) {
+ EX_T(opline->op1.var).var.fcall_returned_reference) {
+ } else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) {
if (OP1_TYPE == IS_VAR && !OP1_FREE) {
PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
}
@@ -2547,9 +2556,9 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, ANY, CV)
ZEND_VM_CONTINUE(); /* CHECK_ME */
}
ce = Z_OBJCE_P(EG(exception));
- if (ce != EX_T(opline->op1.u.var).class_entry) {
- if (!instanceof_function(ce, EX_T(opline->op1.u.var).class_entry TSRMLS_CC)) {
- if (opline->op1.u.EA.type) {
+ if (ce != EX_T(opline->op1.var).class_entry) {
+ if (!instanceof_function(ce, EX_T(opline->op1.var).class_entry TSRMLS_CC)) {
+ if (opline->result.num) {
zend_throw_exception_internal(NULL TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
}
@@ -2559,15 +2568,15 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, ANY, CV)
}
if (!EG(active_symbol_table)) {
- if (EX(CVs)[opline->op2.u.var]) {
- zval_ptr_dtor(EX(CVs)[opline->op2.u.var]);
+ if (EX(CVs)[opline->op2.var]) {
+ zval_ptr_dtor(EX(CVs)[opline->op2.var]);
}
- EX(CVs)[opline->op2.u.var] = (zval**)EX(CVs) + (EX(op_array)->last_var + opline->op2.u.var);
- *EX(CVs)[opline->op2.u.var] = EG(exception);
+ EX(CVs)[opline->op2.var] = (zval**)EX(CVs) + (EX(op_array)->last_var + opline->op2.var);
+ *EX(CVs)[opline->op2.var] = EG(exception);
} else {
- zend_compiled_variable *cv = &CV_DEF_OF(opline->op2.u.var);
+ zend_compiled_variable *cv = &CV_DEF_OF(opline->op2.var);
zend_hash_quick_update(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value,
- &EG(exception), sizeof(zval *), (void**)&EX(CVs)[opline->op2.u.var]);
+ &EG(exception), sizeof(zval *), (void**)&EX(CVs)[opline->op2.var]);
}
EG(exception) = NULL;
ZEND_VM_NEXT_OPCODE();
@@ -2577,8 +2586,8 @@ ZEND_VM_HANDLER(65, ZEND_SEND_VAL, CONST|TMP|VAR|CV, ANY)
{
zend_op *opline = EX(opline);
if (opline->extended_value==ZEND_DO_FCALL_BY_NAME
- && ARG_MUST_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
- zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.u.opline_num);
+ && ARG_MUST_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
+ zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.opline_num);
}
{
zval *valptr;
@@ -2635,21 +2644,21 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY)
if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) {
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
}
- } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
+ } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
}
if (OP1_TYPE == IS_VAR &&
(opline->extended_value & ZEND_ARG_SEND_FUNCTION) &&
- EX_T(opline->op1.u.var).var.fcall_returned_reference &&
- EX_T(opline->op1.u.var).var.ptr) {
- varptr = EX_T(opline->op1.u.var).var.ptr;
+ EX_T(opline->op1.var).var.fcall_returned_reference &&
+ EX_T(opline->op1.var).var.ptr) {
+ varptr = EX_T(opline->op1.var).var.ptr;
PZVAL_UNLOCK_EX(varptr, &free_op1, 0);
} else {
varptr = GET_OP1_ZVAL_PTR(BP_VAR_R);
}
if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) ||
- EX_T(opline->op1.u.var).var.fcall_returned_reference) &&
+ EX_T(opline->op1.var).var.fcall_returned_reference) &&
varptr != &EG(uninitialized_zval) &&
(PZVAL_IS_REF(varptr) ||
(Z_REFCOUNT_P(varptr) == 1 && (OP1_TYPE == IS_CV || free_op1.var)))) {
@@ -2661,7 +2670,7 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY)
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
- !ARG_MAY_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
+ !ARG_MAY_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
zend_error(E_STRICT, "Only variables should be passed by reference");
}
ALLOC_ZVAL(valptr);
@@ -2687,7 +2696,7 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
}
- if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
+ if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
}
@@ -2705,7 +2714,7 @@ ZEND_VM_HANDLER(66, ZEND_SEND_VAR, VAR|CV, ANY)
zend_op *opline = EX(opline);
if ((opline->extended_value == ZEND_DO_FCALL_BY_NAME)
- && ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
+ && ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
ZEND_VM_DISPATCH_TO_HANDLER(ZEND_SEND_REF);
}
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
@@ -2714,7 +2723,7 @@ ZEND_VM_HANDLER(66, ZEND_SEND_VAR, VAR|CV, ANY)
ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
{
zend_op *opline = EX(opline);
- zend_uint arg_num = Z_LVAL(opline->op1.u.constant);
+ zend_uint arg_num = opline->op1.num;
zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC);
if (param == NULL) {
@@ -2724,20 +2733,20 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
if (zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL, opline->extended_value TSRMLS_CC)) {
if(ptr && ptr->op_array) {
- zend_error(E_WARNING, "Missing argument %ld for %s%s%s(), called in %s on line %d and defined", opline->op1.u.constant.value.lval, class_name, space, get_active_function_name(TSRMLS_C), ptr->op_array->filename, ptr->opline->lineno);
+ zend_error(E_WARNING, "Missing argument %u for %s%s%s(), called in %s on line %d and defined", opline->op1.num, class_name, space, get_active_function_name(TSRMLS_C), ptr->op_array->filename, ptr->opline->lineno);
} else {
- zend_error(E_WARNING, "Missing argument %ld for %s%s%s()", opline->op1.u.constant.value.lval, class_name, space, get_active_function_name(TSRMLS_C));
+ zend_error(E_WARNING, "Missing argument %u for %s%s%s()", opline->op1.num, class_name, space, get_active_function_name(TSRMLS_C));
}
}
- if (opline->result.op_type == IS_VAR) {
- PZVAL_UNLOCK_FREE(*EX_T(opline->result.u.var).var.ptr_ptr);
+ if (opline->result_type == IS_VAR) {
+ PZVAL_UNLOCK_FREE(*EX_T(opline->result.var).var.ptr_ptr);
}
} else {
zend_free_op free_res;
zval **var_ptr;
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC);
- var_ptr = get_zval_ptr_ptr(&opline->result, EX(Ts), &free_res, BP_VAR_W);
+ var_ptr = get_zval_ptr_ptr(opline->result_type, &opline->result, EX(Ts), &free_res, BP_VAR_W);
Z_DELREF_PP(var_ptr);
*var_ptr = *param;
Z_ADDREF_PP(var_ptr);
@@ -2750,15 +2759,16 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
{
zend_op *opline = EX(opline);
zval *assignment_value;
- zend_uint arg_num = Z_LVAL(opline->op1.u.constant);
+ zend_uint arg_num = opline->op1.num;
zend_free_op free_res;
zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC);
zval **var_ptr;
if (param == NULL) {
ALLOC_ZVAL(assignment_value);
- *assignment_value = opline->op2.u.constant;
- if ((Z_TYPE(opline->op2.u.constant) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT || Z_TYPE(opline->op2.u.constant)==IS_CONSTANT_ARRAY) {
+ *assignment_value = *opline->op2.zv;
+ if ((Z_TYPE_P(assignment_value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT ||
+ Z_TYPE_P(assignment_value)==IS_CONSTANT_ARRAY) {
Z_SET_REFCOUNT_P(assignment_value, 1);
zval_update_constant(&assignment_value, 0 TSRMLS_CC);
} else {
@@ -2771,7 +2781,7 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
}
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value TSRMLS_CC);
- var_ptr = get_zval_ptr_ptr(&opline->result, EX(Ts), &free_res, BP_VAR_W);
+ var_ptr = get_zval_ptr_ptr(opline->result_type, &opline->result, EX(Ts), &free_res, BP_VAR_W);
Z_DELREF_PP(var_ptr);
*var_ptr = assignment_value;
@@ -2784,8 +2794,8 @@ ZEND_VM_HANDLER(52, ZEND_BOOL, CONST|TMP|VAR|CV, ANY)
zend_free_op free_op1;
/* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R));
- Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R));
+ Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
FREE_OP1();
ZEND_VM_NEXT_OPCODE();
@@ -2797,7 +2807,7 @@ ZEND_VM_HANDLER(50, ZEND_BRK, ANY, CONST|TMP|VAR|CV)
zend_free_op free_op2;
zend_brk_cont_element *el;
- el = zend_brk_cont(GET_OP2_ZVAL_PTR(BP_VAR_R), opline->op1.u.opline_num,
+ el = zend_brk_cont(GET_OP2_ZVAL_PTR(BP_VAR_R), opline->op1.opline_num,
EX(op_array), EX(Ts) TSRMLS_CC);
FREE_OP2();
ZEND_VM_JMP(EX(op_array)->opcodes + el->brk);
@@ -2809,7 +2819,7 @@ ZEND_VM_HANDLER(51, ZEND_CONT, ANY, CONST|TMP|VAR|CV)
zend_free_op free_op2;
zend_brk_cont_element *el;
- el = zend_brk_cont(GET_OP2_ZVAL_PTR(BP_VAR_R), opline->op1.u.opline_num,
+ el = zend_brk_cont(GET_OP2_ZVAL_PTR(BP_VAR_R), opline->op1.opline_num,
EX(op_array), EX(Ts) TSRMLS_CC);
FREE_OP2();
ZEND_VM_JMP(EX(op_array)->opcodes + el->cont);
@@ -2821,24 +2831,24 @@ ZEND_VM_HANDLER(100, ZEND_GOTO, ANY, CONST)
zend_op *opline = EX(opline);
zend_brk_cont_element *el;
- el = zend_brk_cont(&opline->op2.u.constant, opline->extended_value,
+ el = zend_brk_cont(opline->op2.zv, opline->extended_value,
EX(op_array), EX(Ts) TSRMLS_CC);
brk_opline = EX(op_array)->opcodes + el->brk;
switch (brk_opline->opcode) {
case ZEND_SWITCH_FREE:
- if (brk_opline->op1.u.EA.type != EXT_TYPE_FREE_ON_RETURN) {
- zend_switch_free(&EX_T(brk_opline->op1.u.var), brk_opline->extended_value TSRMLS_CC);
+ if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) {
+ zend_switch_free(&EX_T(brk_opline->op1.var), brk_opline->extended_value TSRMLS_CC);
}
break;
case ZEND_FREE:
- if (brk_opline->op1.u.EA.type != EXT_TYPE_FREE_ON_RETURN) {
- zendi_zval_dtor(EX_T(brk_opline->op1.u.var).tmp_var);
+ if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) {
+ zendi_zval_dtor(EX_T(brk_opline->op1.var).tmp_var);
}
break;
}
- ZEND_VM_JMP(opline->op1.u.jmp_addr);
+ ZEND_VM_JMP(opline->op1.jmp_addr);
}
ZEND_VM_HANDLER(48, ZEND_CASE, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
@@ -2848,14 +2858,14 @@ ZEND_VM_HANDLER(48, ZEND_CASE, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
zend_free_op free_op1, free_op2;
if (OP1_TYPE==IS_VAR) {
- if (EX_T(opline->op1.u.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr);
+ if (EX_T(opline->op1.var).var.ptr_ptr) {
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
} else {
switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.u.var).str_offset.str);
+ Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
}
}
- is_equal_function(&EX_T(opline->result.u.var).tmp_var,
+ is_equal_function(&EX_T(opline->result.var).tmp_var,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
@@ -2867,8 +2877,8 @@ ZEND_VM_HANDLER(48, ZEND_CASE, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
* are allocated at each get_zval_ptr())
*/
FREE_OP1();
- EX_T(opline->op1.u.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.u.var).var.ptr = NULL;
+ EX_T(opline->op1.var).var.ptr_ptr = NULL;
+ EX_T(opline->op1.var).var.ptr = NULL;
}
ZEND_VM_NEXT_OPCODE();
}
@@ -2877,7 +2887,7 @@ ZEND_VM_HANDLER(49, ZEND_SWITCH_FREE, VAR, ANY)
{
zend_op *opline = EX(opline);
- zend_switch_free(&EX_T(opline->op1.u.var), opline->extended_value TSRMLS_CC);
+ zend_switch_free(&EX_T(opline->op1.var), opline->extended_value TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
}
@@ -2887,32 +2897,32 @@ ZEND_VM_HANDLER(68, ZEND_NEW, ANY, ANY)
zval *object_zval;
zend_function *constructor;
- if (EX_T(opline->op1.u.var).class_entry->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) {
+ if (EX_T(opline->op1.var).class_entry->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) {
char *class_type;
- if (EX_T(opline->op1.u.var).class_entry->ce_flags & ZEND_ACC_INTERFACE) {
+ if (EX_T(opline->op1.var).class_entry->ce_flags & ZEND_ACC_INTERFACE) {
class_type = "interface";
} else {
class_type = "abstract class";
}
- zend_error_noreturn(E_ERROR, "Cannot instantiate %s %s", class_type, EX_T(opline->op1.u.var).class_entry->name);
+ zend_error_noreturn(E_ERROR, "Cannot instantiate %s %s", class_type, EX_T(opline->op1.var).class_entry->name);
}
ALLOC_ZVAL(object_zval);
- object_init_ex(object_zval, EX_T(opline->op1.u.var).class_entry);
+ object_init_ex(object_zval, EX_T(opline->op1.var).class_entry);
INIT_PZVAL(object_zval);
constructor = Z_OBJ_HT_P(object_zval)->get_constructor(object_zval TSRMLS_CC);
if (constructor == NULL) {
if (RETURN_VALUE_USED(opline)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, object_zval);
+ AI_SET_PTR(EX_T(opline->result.var).var, object_zval);
} else {
zval_ptr_dtor(&object_zval);
}
- ZEND_VM_JMP(EX(op_array)->opcodes + opline->op2.u.opline_num);
+ ZEND_VM_JMP(EX(op_array)->opcodes + opline->op2.opline_num);
} else {
if (RETURN_VALUE_USED(opline)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, object_zval);
+ AI_SET_PTR(EX_T(opline->result.var).var, object_zval);
PZVAL_LOCK(object_zval);
}
@@ -2921,7 +2931,7 @@ ZEND_VM_HANDLER(68, ZEND_NEW, ANY, ANY)
/* We are not handling overloaded classes right now */
EX(object) = object_zval;
EX(fbc) = constructor;
- EX(called_scope) = EX_T(opline->op1.u.var).class_entry;
+ EX(called_scope) = EX_T(opline->op1.var).class_entry;
ZEND_VM_NEXT_OPCODE();
}
@@ -2969,15 +2979,15 @@ ZEND_VM_HANDLER(110, ZEND_CLONE, CONST|TMP|VAR|UNUSED|CV, ANY)
}
}
- EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
+ EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
if (!EG(exception)) {
- ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
- Z_OBJVAL_P(EX_T(opline->result.u.var).var.ptr) = clone_call(obj TSRMLS_CC);
- Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_OBJECT;
- Z_SET_REFCOUNT_P(EX_T(opline->result.u.var).var.ptr, 1);
- Z_SET_ISREF_P(EX_T(opline->result.u.var).var.ptr);
+ ALLOC_ZVAL(EX_T(opline->result.var).var.ptr);
+ Z_OBJVAL_P(EX_T(opline->result.var).var.ptr) = clone_call(obj TSRMLS_CC);
+ Z_TYPE_P(EX_T(opline->result.var).var.ptr) = IS_OBJECT;
+ Z_SET_REFCOUNT_P(EX_T(opline->result.var).var.ptr, 1);
+ Z_SET_ISREF_P(EX_T(opline->result.var).var.ptr);
if (!RETURN_VALUE_USED(opline) || EG(exception)) {
- zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
+ zval_ptr_dtor(&EX_T(opline->result.var).var.ptr);
}
}
FREE_OP1_IF_VAR();
@@ -2990,20 +3000,20 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
if (OP1_TYPE == IS_UNUSED) {
/* namespaced constant */
- if (!zend_get_constant_ex(Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant), &EX_T(opline->result.u.var).tmp_var, NULL, opline->extended_value TSRMLS_CC)) {
+ if (!zend_get_constant_ex(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), &EX_T(opline->result.var).tmp_var, NULL, opline->extended_value TSRMLS_CC)) {
if ((opline->extended_value & IS_CONSTANT_UNQUALIFIED) != 0) {
- char *actual = (char *)zend_memrchr(Z_STRVAL(opline->op2.u.constant), '\\', Z_STRLEN(opline->op2.u.constant));
+ char *actual = (char *)zend_memrchr(Z_STRVAL_P(opline->op2.zv), '\\', Z_STRLEN_P(opline->op2.zv));
if(!actual) {
- actual = Z_STRVAL(opline->op2.u.constant);
+ actual = Z_STRVAL_P(opline->op2.zv);
} else {
actual++;
}
/* non-qualified constant - allow text substitution */
zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", actual, actual);
- ZVAL_STRINGL(&EX_T(opline->result.u.var).tmp_var, actual, Z_STRLEN(opline->op2.u.constant)-(actual - Z_STRVAL(opline->op2.u.constant)), 1);
+ ZVAL_STRINGL(&EX_T(opline->result.var).tmp_var, actual, Z_STRLEN_P(opline->op2.zv)-(actual - Z_STRVAL_P(opline->op2.zv)), 1);
} else {
zend_error_noreturn(E_ERROR, "Undefined constant '%s'",
- Z_STRVAL(opline->op2.u.constant), Z_STRVAL(opline->op2.u.constant));
+ Z_STRVAL_P(opline->op2.zv), Z_STRVAL_P(opline->op2.zv));
}
}
ZEND_VM_NEXT_OPCODE();
@@ -3014,15 +3024,15 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
if (OP1_TYPE == IS_CONST) {
- ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
if (!ce) {
- zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL(opline->op2.u.constant));
+ zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv));
}
} else {
- ce = EX_T(opline->op1.u.var).class_entry;
+ ce = EX_T(opline->op1.var).class_entry;
}
- if (zend_hash_find(&ce->constants_table, Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant)+1, (void **) &value) == SUCCESS) {
+ if (zend_hash_quick_find(&ce->constants_table, Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv)+1, Z_HASH_P(opline->op2.zv), (void **) &value) == SUCCESS) {
if (Z_TYPE_PP(value) == IS_CONSTANT_ARRAY ||
(Z_TYPE_PP(value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
zend_class_entry *old_scope = EG(scope);
@@ -3031,10 +3041,10 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
zval_update_constant(value, (void *) 1 TSRMLS_CC);
EG(scope) = old_scope;
}
- EX_T(opline->result.u.var).tmp_var = **value;
- zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var);
+ EX_T(opline->result.var).tmp_var = **value;
+ zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
} else {
- zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL(opline->op2.u.constant));
+ zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv));
}
ZEND_VM_NEXT_OPCODE();
@@ -3045,9 +3055,11 @@ ZEND_VM_HANDLER(72, ZEND_ADD_ARRAY_ELEMENT, CONST|TMP|VAR|CV, CONST|TMP|VAR|UNUS
{
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- zval *array_ptr = &EX_T(opline->result.u.var).tmp_var;
+ zval *array_ptr = &EX_T(opline->result.var).tmp_var;
zval *expr_ptr;
zval *offset=GET_OP2_ZVAL_PTR(BP_VAR_R);
+ ulong hval;
+ long index;
#if !defined(ZEND_VM_SPEC) || OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV
zval **expr_ptr_ptr = NULL;
@@ -3090,14 +3102,22 @@ ZEND_VM_HANDLER(72, ZEND_ADD_ARRAY_ELEMENT, CONST|TMP|VAR|CV, CONST|TMP|VAR|UNUS
if (offset) {
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL);
- break;
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ ZEND_VM_C_GOTO(num_index);
case IS_LONG:
case IS_BOOL:
- zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
+ index = Z_LVAL_P(offset);
+ZEND_VM_C_LABEL(num_index):
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), index, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
+ if (OP2_TYPE == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, ZEND_VM_C_GOTO(num_index));
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
+ }
+ zend_hash_quick_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
@@ -3124,7 +3144,7 @@ ZEND_VM_HANDLER(71, ZEND_INIT_ARRAY, CONST|TMP|VAR|UNUSED|CV, CONST|TMP|VAR|UNUS
{
zend_op *opline = EX(opline);
- array_init(&EX_T(opline->result.u.var).tmp_var);
+ array_init(&EX_T(opline->result.var).tmp_var);
if (OP1_TYPE == IS_UNUSED) {
ZEND_VM_NEXT_OPCODE();
#if !defined(ZEND_VM_SPEC) || OP1_TYPE != IS_UNUSED
@@ -3139,7 +3159,7 @@ ZEND_VM_HANDLER(21, ZEND_CAST, CONST|TMP|VAR|CV, ANY)
zend_op *opline = EX(opline);
zend_free_op free_op1;
zval *expr = GET_OP1_ZVAL_PTR(BP_VAR_R);
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
if (opline->extended_value != IS_STRING) {
*result = *expr;
@@ -3208,7 +3228,7 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
return_value_used = RETURN_VALUE_USED(opline);
- switch (Z_LVAL(opline->op2.u.constant)) {
+ switch (opline->extended_value) {
case ZEND_INCLUDE_ONCE:
case ZEND_REQUIRE_ONCE: {
zend_file_handle file_handle;
@@ -3230,14 +3250,14 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
}
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
- new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
+ new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
zend_destroy_file_handle(&file_handle TSRMLS_CC);
} else {
zend_file_handle_dtor(&file_handle TSRMLS_CC);
failure_retval=1;
}
} else {
- if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) {
+ if (opline->extended_value == ZEND_INCLUDE_ONCE) {
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
} else {
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
@@ -3250,7 +3270,7 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
break;
case ZEND_INCLUDE:
case ZEND_REQUIRE:
- new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC);
+ new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
break;
case ZEND_EVAL: {
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
@@ -3265,12 +3285,12 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
zval_dtor(&tmp_inc_filename);
}
FREE_OP1();
- EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
+ EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
if (new_op_array && !EG(exception)) {
EX(original_return_value) = EG(return_value_ptr_ptr);
- EG(return_value_ptr_ptr) = return_value_used ? EX_T(opline->result.u.var).var.ptr_ptr : NULL;
+ EG(return_value_ptr_ptr) = return_value_used ? EX_T(opline->result.var).var.ptr_ptr : NULL;
EG(active_op_array) = new_op_array;
- EX_T(opline->result.u.var).var.ptr = NULL;
+ EX_T(opline->result.var).var.ptr = NULL;
EX(current_object) = EX(object);
@@ -3292,11 +3312,11 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
EX(object) = EX(current_object);
if (return_value_used) {
- if (!EX_T(opline->result.u.var).var.ptr) { /* there was no return statement */
- ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
- INIT_PZVAL(EX_T(opline->result.u.var).var.ptr);
- Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = 1;
- Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL;
+ if (!EX_T(opline->result.var).var.ptr) { /* there was no return statement */
+ ALLOC_ZVAL(EX_T(opline->result.var).var.ptr);
+ INIT_PZVAL(EX_T(opline->result.var).var.ptr);
+ Z_LVAL_P(EX_T(opline->result.var).var.ptr) = 1;
+ Z_TYPE_P(EX_T(opline->result.var).var.ptr) = IS_BOOL;
}
}
@@ -3310,10 +3330,10 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
}
} else {
if (return_value_used) {
- ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
- INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr);
- Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = failure_retval;
- Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL;
+ ALLOC_ZVAL(EX_T(opline->result.var).var.ptr);
+ INIT_ZVAL(*EX_T(opline->result.var).var.ptr);
+ Z_LVAL_P(EX_T(opline->result.var).var.ptr) = failure_retval;
+ Z_TYPE_P(EX_T(opline->result.var).var.ptr) = IS_BOOL;
}
}
ZEND_VM_NEXT_OPCODE();
@@ -3329,7 +3349,7 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, ANY)
if (OP1_TYPE == IS_CV && (opline->extended_value & ZEND_QUICK_SET)) {
if (EG(active_symbol_table)) {
zend_execute_data *ex = EX(prev_execute_data);
- zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.u.var);
+ zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
if (zend_hash_quick_del(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value) == SUCCESS) {
while (ex && ex->symbol_table == EG(active_symbol_table)) {
@@ -3348,17 +3368,17 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, ANY)
ex = ex->prev_execute_data;
}
}
- EX(CVs)[opline->op1.u.var] = NULL;
- } else if (EX(CVs)[opline->op1.u.var]) {
- zval_ptr_dtor(EX(CVs)[opline->op1.u.var]);
- EX(CVs)[opline->op1.u.var] = NULL;
+ EX(CVs)[opline->op1.var] = NULL;
+ } else if (EX(CVs)[opline->op1.var]) {
+ zval_ptr_dtor(EX(CVs)[opline->op1.var]);
+ EX(CVs)[opline->op1.var] = NULL;
}
ZEND_VM_NEXT_OPCODE();
}
varname = GET_OP1_ZVAL_PTR(BP_VAR_R);
- if (Z_TYPE_P(varname) != IS_STRING) {
+ if (OP1_TYPE != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
tmp = *varname;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
@@ -3367,12 +3387,12 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, ANY)
Z_ADDREF_P(varname);
}
- if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
- zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname) TSRMLS_CC);
+ if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC_MEMBER) {
+ zend_std_unset_static_property(EX_T(opline->op2.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((OP1_TYPE == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
} else {
ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
- target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
if (zend_hash_quick_del(target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value) == SUCCESS) {
zend_execute_data *ex = EXECUTE_DATA;
@@ -3409,6 +3429,8 @@ ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
zend_free_op free_op1, free_op2;
zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_UNSET);
zval *offset = GET_OP2_ZVAL_PTR(BP_VAR_R);
+ ulong hval;
+ long index;
if (OP1_TYPE != IS_VAR || container) {
if (OP1_TYPE == IS_CV && container != &EG(uninitialized_zval_ptr)) {
@@ -3420,28 +3442,35 @@ ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_del(ht, zend_dval_to_lval(Z_DVAL_P(offset)));
- break;
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ ZEND_VM_C_GOTO(num_index_dim);
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- zend_hash_index_del(ht, Z_LVAL_P(offset));
+ZEND_VM_C_LABEL(num_index_dim):
+ index = Z_LVAL_P(offset);
+ zend_hash_index_del(ht, index);
break;
case IS_STRING:
if (OP2_TYPE == IS_CV || OP2_TYPE == IS_VAR) {
Z_ADDREF_P(offset);
}
- if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS &&
+ if (OP2_TYPE == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, ZEND_VM_C_GOTO(num_index_dim));
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
+ }
+ if (zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
- ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1);
for (ex = EXECUTE_DATA; ex; ex = ex->prev_execute_data) {
if (ex->op_array && ex->symbol_table == ht) {
int i;
for (i = 0; i < ex->op_array->last_var; i++) {
- if (ex->op_array->vars[i].hash_value == hash_value &&
+ if (ex->op_array->vars[i].hash_value == hval &&
ex->op_array->vars[i].name_len == offset->value.str.len &&
!memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) {
ex->CVs[i] = NULL;
@@ -3510,7 +3539,7 @@ ZEND_VM_HANDLER(76, ZEND_UNSET_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
MAKE_REAL_ZVAL_PTR(offset);
}
if (Z_OBJ_HT_P(*container)->unset_property) {
- Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+ Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
} else {
zend_error(E_NOTICE, "Trying to unset property of non-object");
}
@@ -3547,7 +3576,7 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
} else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) {
if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) {
zend_error(E_WARNING, "foreach() cannot iterate over objects without PHP class");
- ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
+ ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
}
ce = Z_OBJCE_PP(array_ptr_ptr);
@@ -3619,7 +3648,7 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
}
}
- AI_SET_PTR(EX_T(opline->result.u.var).var, array_ptr);
+ AI_SET_PTR(EX_T(opline->result.var).var, array_ptr);
PZVAL_LOCK(array_ptr);
if (iter) {
@@ -3669,7 +3698,7 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
}
}
is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS;
- zend_hash_get_pointer(fe_ht, &EX_T(opline->result.u.var).fe.fe_pos);
+ zend_hash_get_pointer(fe_ht, &EX_T(opline->result.var).fe.fe_pos);
} else {
zend_error(E_WARNING, "Invalid argument supplied for foreach()");
is_empty = 1;
@@ -3681,7 +3710,7 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
FREE_OP1_IF_VAR();
}
if (is_empty) {
- ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
+ ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
} else {
ZEND_VM_NEXT_OPCODE();
}
@@ -3691,7 +3720,7 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *array = EX_T(opline->op1.u.var).var.ptr;
+ zval *array = EX_T(opline->op1.var).var.ptr;
zval **value;
char *str_key;
uint str_key_len;
@@ -3705,18 +3734,18 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
default:
case ZEND_ITER_INVALID:
zend_error(E_WARNING, "Invalid argument supplied for foreach()");
- ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
+ ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
case ZEND_ITER_PLAIN_OBJECT: {
char *class_name, *prop_name;
zend_object *zobj = zend_objects_get_address(array TSRMLS_CC);
fe_ht = HASH_OF(array);
- zend_hash_set_pointer(fe_ht, &EX_T(opline->op1.u.var).fe.fe_pos);
+ zend_hash_set_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
do {
if (zend_hash_get_current_data(fe_ht, (void **) &value)==FAILURE) {
/* reached end of iteration */
- ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
+ ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
}
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
@@ -3724,7 +3753,7 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
} while (key_type == HASH_KEY_NON_EXISTANT ||
(key_type != HASH_KEY_IS_LONG &&
zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) != SUCCESS));
- zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.u.var).fe.fe_pos);
+ zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
if (use_key && key_type != HASH_KEY_IS_LONG) {
zend_unmangle_property_name(str_key, str_key_len-1, &class_name, &prop_name);
str_key_len = strlen(prop_name);
@@ -3736,16 +3765,16 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
case ZEND_ITER_PLAIN_ARRAY:
fe_ht = HASH_OF(array);
- zend_hash_set_pointer(fe_ht, &EX_T(opline->op1.u.var).fe.fe_pos);
+ zend_hash_set_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
if (zend_hash_get_current_data(fe_ht, (void **) &value)==FAILURE) {
/* reached end of iteration */
- ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
+ ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
}
if (use_key) {
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 1, NULL);
}
zend_hash_move_forward(fe_ht);
- zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.u.var).fe.fe_pos);
+ zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
break;
case ZEND_ITER_OBJECT:
@@ -3768,7 +3797,7 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
zval_ptr_dtor(&array);
ZEND_VM_NEXT_OPCODE();
}
- ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
+ ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
}
iter->funcs->get_current_data(iter, &value TSRMLS_CC);
if (EG(exception)) {
@@ -3778,7 +3807,7 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
}
if (!value) {
/* failure in get_current_data */
- ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
+ ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
}
if (use_key) {
if (iter->funcs->get_current_key) {
@@ -3799,16 +3828,16 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
if (opline->extended_value & ZEND_FE_FETCH_BYREF) {
SEPARATE_ZVAL_IF_NOT_REF(value);
Z_SET_ISREF_PP(value);
- EX_T(opline->result.u.var).var.ptr_ptr = value;
+ EX_T(opline->result.var).var.ptr_ptr = value;
Z_ADDREF_PP(value);
} else {
- AI_SET_PTR(EX_T(opline->result.u.var).var, *value);
+ AI_SET_PTR(EX_T(opline->result.var).var, *value);
PZVAL_LOCK(*value);
}
if (use_key) {
zend_op *op_data = opline+1;
- zval *key = &EX_T(op_data->result.u.var).tmp_var;
+ zval *key = &EX_T(op_data->result.var).tmp_var;
switch (key_type) {
case HASH_KEY_IS_STRING:
@@ -3838,10 +3867,10 @@ ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMP|VAR|CV, ANY)
zend_bool isset = 1;
if (OP1_TYPE == IS_CV && (opline->extended_value & ZEND_QUICK_SET)) {
- if (EX(CVs)[opline->op1.u.var]) {
- value = EX(CVs)[opline->op1.u.var];
+ if (EX(CVs)[opline->op1.var]) {
+ value = EX(CVs)[opline->op1.var];
} else if (EG(active_symbol_table)) {
- zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.u.var);
+ zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
isset = 0;
@@ -3854,20 +3883,20 @@ ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMP|VAR|CV, ANY)
zend_free_op free_op1;
zval tmp, *varname = GET_OP1_ZVAL_PTR(BP_VAR_IS);
- if (Z_TYPE_P(varname) != IS_STRING) {
+ if (OP1_TYPE != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
tmp = *varname;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
varname = &tmp;
}
- if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
- value = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1 TSRMLS_CC);
+ if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC_MEMBER) {
+ value = zend_std_get_static_property(EX_T(opline->op2.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1, ((OP1_TYPE == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
if (!value) {
isset = 0;
}
} else {
- target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) {
isset = 0;
}
@@ -3879,23 +3908,20 @@ ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMP|VAR|CV, ANY)
FREE_OP1();
}
- Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
+ Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
- switch (opline->extended_value & ZEND_ISSET_ISEMPTY_MASK) {
- case ZEND_ISSET:
- if (isset && Z_TYPE_PP(value) == IS_NULL) {
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0;
- } else {
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = isset;
- }
- break;
- case ZEND_ISEMPTY:
- if (!isset || !i_zend_is_true(*value)) {
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1;
- } else {
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0;
- }
- break;
+ if (opline->extended_value & ZEND_ISSET) {
+ if (isset && Z_TYPE_PP(value) == IS_NULL) {
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = 0;
+ } else {
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = isset;
+ }
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (!isset || !i_zend_is_true(*value)) {
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = 1;
+ } else {
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = 0;
+ }
}
ZEND_VM_NEXT_OPCODE();
@@ -3908,6 +3934,8 @@ ZEND_VM_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, VAR|UNUSED|CV, CONST|
zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_IS);
zval **value = NULL;
int result = 0;
+ ulong hval;
+ long index;
if (OP1_TYPE != IS_VAR || container) {
zend_free_op free_op2;
@@ -3921,19 +3949,27 @@ ZEND_VM_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, VAR|UNUSED|CV, CONST|
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- if (zend_hash_index_find(ht, zend_dval_to_lval(Z_DVAL_P(offset)), (void **) &value) == SUCCESS) {
- isset = 1;
- }
- break;
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ ZEND_VM_C_GOTO(num_index_prop);
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (zend_hash_index_find(ht, Z_LVAL_P(offset), (void **) &value) == SUCCESS) {
+ index = Z_LVAL_P(offset);
+ZEND_VM_C_LABEL(num_index_prop):
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
isset = 1;
}
break;
case IS_STRING:
- if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) {
+ if (OP2_TYPE == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ if (!prop_dim) {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, ZEND_VM_C_GOTO(num_index_prop));
+ }
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
+ }
+ if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) {
isset = 1;
}
break;
@@ -3948,21 +3984,18 @@ ZEND_VM_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, VAR|UNUSED|CV, CONST|
break;
}
- switch (opline->extended_value) {
- case ZEND_ISSET:
- if (isset && Z_TYPE_PP(value) == IS_NULL) {
- result = 0;
- } else {
- result = isset;
- }
- break;
- case ZEND_ISEMPTY:
- if (!isset || !i_zend_is_true(*value)) {
- result = 0;
- } else {
- result = 1;
- }
- break;
+ if (opline->extended_value & ZEND_ISSET) {
+ if (isset && Z_TYPE_PP(value) == IS_NULL) {
+ result = 0;
+ } else {
+ result = isset;
+ }
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (!isset || !i_zend_is_true(*value)) {
+ result = 0;
+ } else {
+ result = 1;
+ }
}
FREE_OP2();
} else if (Z_TYPE_PP(container) == IS_OBJECT) {
@@ -3971,14 +4004,14 @@ ZEND_VM_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, VAR|UNUSED|CV, CONST|
}
if (prop_dim) {
if (Z_OBJ_HT_P(*container)->has_property) {
- result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+ result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
} else {
zend_error(E_NOTICE, "Trying to check property of non-object");
result = 0;
}
} else {
if (Z_OBJ_HT_P(*container)->has_dimension) {
- result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+ result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
} else {
zend_error(E_NOTICE, "Trying to check element of non-array");
result = 0;
@@ -3999,17 +4032,14 @@ ZEND_VM_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, VAR|UNUSED|CV, CONST|
offset = &tmp;
}
if (Z_TYPE_P(offset) == IS_LONG) {
- switch (opline->extended_value) {
- case ZEND_ISSET:
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
- result = 1;
- }
- break;
- case ZEND_ISEMPTY:
- if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
- result = 1;
- }
- break;
+ if (opline->extended_value & ZEND_ISSET) {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
+ result = 1;
+ }
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
+ result = 1;
+ }
}
}
FREE_OP2();
@@ -4018,15 +4048,12 @@ ZEND_VM_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, VAR|UNUSED|CV, CONST|
}
}
- Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
+ Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
- switch (opline->extended_value) {
- case ZEND_ISSET:
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result;
- break;
- case ZEND_ISEMPTY:
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result;
- break;
+ if (opline->extended_value & ZEND_ISSET) {
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = result;
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = !result;
}
FREE_OP1_VAR_PTR();
@@ -4068,10 +4095,10 @@ ZEND_VM_HANDLER(57, ZEND_BEGIN_SILENCE, ANY, ANY)
{
zend_op *opline = EX(opline);
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = EG(error_reporting);
- Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG; /* shouldn't be necessary */
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = EG(error_reporting);
+ Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_LONG; /* shouldn't be necessary */
if (EX(old_error_reporting) == NULL) {
- EX(old_error_reporting) = &EX_T(opline->result.u.var).tmp_var;
+ EX(old_error_reporting) = &EX_T(opline->result.var).tmp_var;
}
if (EG(error_reporting)) {
@@ -4091,14 +4118,14 @@ ZEND_VM_HANDLER(58, ZEND_END_SILENCE, TMP, ANY)
zend_op *opline = EX(opline);
zval restored_error_reporting;
- if (!EG(error_reporting) && Z_LVAL(EX_T(opline->op1.u.var).tmp_var) != 0) {
+ if (!EG(error_reporting) && Z_LVAL(EX_T(opline->op1.var).tmp_var) != 0) {
Z_TYPE(restored_error_reporting) = IS_LONG;
- Z_LVAL(restored_error_reporting) = Z_LVAL(EX_T(opline->op1.u.var).tmp_var);
+ Z_LVAL(restored_error_reporting) = Z_LVAL(EX_T(opline->op1.var).tmp_var);
convert_to_string(&restored_error_reporting);
zend_alter_ini_entry_ex("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME, 1 TSRMLS_CC);
zendi_zval_dtor(restored_error_reporting);
}
- if (EX(old_error_reporting) == &EX_T(opline->op1.u.var).tmp_var) {
+ if (EX(old_error_reporting) == &EX_T(opline->op1.var).tmp_var) {
EX(old_error_reporting) = NULL;
}
ZEND_VM_NEXT_OPCODE();
@@ -4111,13 +4138,13 @@ ZEND_VM_HANDLER(152, ZEND_JMP_SET, CONST|TMP|VAR|CV, ANY)
zval *value = GET_OP1_ZVAL_PTR(BP_VAR_R);
if (i_zend_is_true(value)) {
- EX_T(opline->result.u.var).tmp_var = *value;
- zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var);
+ EX_T(opline->result.var).tmp_var = *value;
+ zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var);
FREE_OP1();
#if DEBUG_ZEND>=2
- printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
+ printf("Conditional jmp to %d\n", opline->op2.opline_num);
#endif
- ZEND_VM_JMP(opline->op2.u.jmp_addr);
+ ZEND_VM_JMP(opline->op2.jmp_addr);
}
FREE_OP1();
@@ -4130,9 +4157,9 @@ ZEND_VM_HANDLER(22, ZEND_QM_ASSIGN, CONST|TMP|VAR|CV, ANY)
zend_free_op free_op1;
zval *value = GET_OP1_ZVAL_PTR(BP_VAR_R);
- EX_T(opline->result.u.var).tmp_var = *value;
+ EX_T(opline->result.var).tmp_var = *value;
if (!IS_OP1_TMP_FREE()) {
- zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var);
+ zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
}
FREE_OP1_IF_VAR();
ZEND_VM_NEXT_OPCODE();
@@ -4166,7 +4193,7 @@ ZEND_VM_HANDLER(139, ZEND_DECLARE_CLASS, ANY, ANY)
{
zend_op *opline = EX(opline);
- EX_T(opline->result.u.var).class_entry = do_bind_class(opline, EG(class_table), 0 TSRMLS_CC);
+ EX_T(opline->result.var).class_entry = do_bind_class(EX(op_array), opline, EG(class_table), 0 TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
}
@@ -4174,7 +4201,7 @@ ZEND_VM_HANDLER(140, ZEND_DECLARE_INHERITED_CLASS, ANY, ANY)
{
zend_op *opline = EX(opline);
- EX_T(opline->result.u.var).class_entry = do_bind_inherited_class(opline, EG(class_table), EX_T(opline->extended_value).class_entry, 0 TSRMLS_CC);
+ EX_T(opline->result.var).class_entry = do_bind_inherited_class(EX(op_array), opline, EG(class_table), EX_T(opline->extended_value).class_entry, 0 TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
}
@@ -4183,28 +4210,28 @@ ZEND_VM_HANDLER(145, ZEND_DECLARE_INHERITED_CLASS_DELAYED, ANY, ANY)
zend_op *opline = EX(opline);
zend_class_entry **pce, **pce_orig;
- if (zend_hash_find(EG(class_table), Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant)+1, (void**)&pce) == FAILURE ||
- (zend_hash_find(EG(class_table), Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), (void**)&pce_orig) == SUCCESS &&
+ if (zend_hash_quick_find(EG(class_table), Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv)+1, Z_HASH_P(opline->op2.zv), (void**)&pce) == FAILURE ||
+ (zend_hash_quick_find(EG(class_table), Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), Z_HASH_P(opline->op1.zv), (void**)&pce_orig) == SUCCESS &&
*pce != *pce_orig)) {
- do_bind_inherited_class(opline, EG(class_table), EX_T(opline->extended_value).class_entry, 0 TSRMLS_CC);
+ do_bind_inherited_class(EX(op_array), opline, EG(class_table), EX_T(opline->extended_value).class_entry, 0 TSRMLS_CC);
}
ZEND_VM_NEXT_OPCODE();
}
ZEND_VM_HANDLER(141, ZEND_DECLARE_FUNCTION, ANY, ANY)
{
- do_bind_function(EX(opline), EG(function_table), 0);
+ do_bind_function(EX(op_array), EX(opline), EG(function_table), 0);
ZEND_VM_NEXT_OPCODE();
}
-ZEND_VM_HANDLER(105, ZEND_TICKS, CONST, ANY)
+ZEND_VM_HANDLER(105, ZEND_TICKS, ANY, ANY)
{
zend_op *opline = EX(opline);
- if (++EG(ticks_count)>=Z_LVAL(opline->op1.u.constant)) {
+ if (++EG(ticks_count)>=opline->extended_value) {
EG(ticks_count)=0;
if (zend_ticks_function) {
- zend_ticks_function(Z_LVAL(opline->op1.u.constant));
+ zend_ticks_function(opline->extended_value);
}
}
ZEND_VM_NEXT_OPCODE();
@@ -4218,11 +4245,11 @@ ZEND_VM_HANDLER(138, ZEND_INSTANCEOF, TMP|VAR|CV, ANY)
zend_bool result;
if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) {
- result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.u.var).class_entry TSRMLS_CC);
+ result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.var).class_entry TSRMLS_CC);
} else {
result = 0;
}
- ZVAL_BOOL(&EX_T(opline->result.u.var).tmp_var, result);
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result);
FREE_OP1();
ZEND_VM_NEXT_OPCODE();
}
@@ -4240,8 +4267,8 @@ ZEND_VM_HANDLER(0, ZEND_NOP, ANY, ANY)
ZEND_VM_HANDLER(144, ZEND_ADD_INTERFACE, ANY, CONST)
{
zend_op *opline = EX(opline);
- zend_class_entry *ce = EX_T(opline->op1.u.var).class_entry;
- zend_class_entry *iface = zend_fetch_class(Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant), opline->extended_value TSRMLS_CC);
+ zend_class_entry *ce = EX_T(opline->op1.var).class_entry;
+ zend_class_entry *iface = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, opline->extended_value TSRMLS_CC);
if (iface) {
if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) {
@@ -4311,13 +4338,13 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
switch (brk_opline->opcode) {
case ZEND_SWITCH_FREE:
- if (brk_opline->op1.u.EA.type != EXT_TYPE_FREE_ON_RETURN) {
- zend_switch_free(&EX_T(brk_opline->op1.u.var), brk_opline->extended_value TSRMLS_CC);
+ if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) {
+ zend_switch_free(&EX_T(brk_opline->op1.var), brk_opline->extended_value TSRMLS_CC);
}
break;
case ZEND_FREE:
- if (brk_opline->op1.u.EA.type != EXT_TYPE_FREE_ON_RETURN) {
- zendi_zval_dtor(EX_T(brk_opline->op1.u.var).tmp_var);
+ if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) {
+ zendi_zval_dtor(EX_T(brk_opline->op1.var).tmp_var);
}
break;
}
@@ -4345,7 +4372,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
ZEND_VM_HANDLER(146, ZEND_VERIFY_ABSTRACT_CLASS, ANY, ANY)
{
- zend_verify_abstract_class(EX_T(EX(opline)->op1.u.var).class_entry TSRMLS_CC);
+ zend_verify_abstract_class(EX_T(EX(opline)->op1.var).class_entry TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
}
@@ -4404,17 +4431,17 @@ ZEND_VM_HANDLER(143, ZEND_DECLARE_CONST, CONST, CONST)
ZEND_VM_NEXT_OPCODE();
}
-ZEND_VM_HANDLER(153, ZEND_DECLARE_LAMBDA_FUNCTION, CONST, CONST)
+ZEND_VM_HANDLER(153, ZEND_DECLARE_LAMBDA_FUNCTION, CONST, UNUSED)
{
zend_op *opline = EX(opline);
zend_function *op_array;
- if (zend_hash_quick_find(EG(function_table), Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), Z_LVAL(opline->op2.u.constant), (void *) &op_array) == FAILURE ||
+ if (zend_hash_quick_find(EG(function_table), Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), Z_HASH_P(opline->op1.zv), (void *) &op_array) == FAILURE ||
op_array->type != ZEND_USER_FUNCTION) {
zend_error_noreturn(E_ERROR, "Base lambda function for closure not found");
}
- zend_create_closure(&EX_T(opline->result.u.var).tmp_var, op_array, EG(scope), EG(This) TSRMLS_CC);
+ zend_create_closure(&EX_T(opline->result.var).tmp_var, op_array, EG(scope), EG(This) TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
}
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index a3c3f85..26434e5 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -123,15 +123,15 @@ zend_vm_enter:
static int ZEND_FASTCALL ZEND_JMP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
#if DEBUG_ZEND>=2
- printf("Jumping to %d\n", EX(opline)->op1.u.opline_num);
+ printf("Jumping to %d\n", EX(opline)->op1.opline_num);
#endif
- ZEND_VM_SET_OPCODE(EX(opline)->op1.u.jmp_addr);
+ ZEND_VM_SET_OPCODE(EX(opline)->op1.jmp_addr);
ZEND_VM_CONTINUE(); /* CHECK_ME */
}
static int ZEND_FASTCALL ZEND_INIT_STRING_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- zval *tmp = &EX_T(EX(opline)->result.u.var).tmp_var;
+ zval *tmp = &EX_T(EX(opline)->result.var).tmp_var;
tmp->value.str.val = emalloc(1);
tmp->value.str.val[0] = 0;
@@ -174,11 +174,11 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
EX(object) = EX(current_object);
if (RETURN_VALUE_USED(EX(call_opline))) {
- if (!EX_T(EX(call_opline)->result.u.var).var.ptr) { /* there was no return statement */
- ALLOC_ZVAL(EX_T(EX(call_opline)->result.u.var).var.ptr);
- INIT_PZVAL(EX_T(EX(call_opline)->result.u.var).var.ptr);
- Z_LVAL_P(EX_T(EX(call_opline)->result.u.var).var.ptr) = 1;
- Z_TYPE_P(EX_T(EX(call_opline)->result.u.var).var.ptr) = IS_BOOL;
+ if (!EX_T(EX(call_opline)->result.var).var.ptr) { /* there was no return statement */
+ ALLOC_ZVAL(EX_T(EX(call_opline)->result.var).var.ptr);
+ INIT_PZVAL(EX_T(EX(call_opline)->result.var).var.ptr);
+ Z_LVAL_P(EX_T(EX(call_opline)->result.var).var.ptr) = 1;
+ Z_TYPE_P(EX_T(EX(call_opline)->result.var).var.ptr) = IS_BOOL;
}
}
@@ -236,8 +236,8 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
if (EG(exception)) {
zend_throw_exception_internal(NULL TSRMLS_CC);
- if (RETURN_VALUE_USED(EX(call_opline)) && EX_T(EX(call_opline)->result.u.var).var.ptr) {
- zval_ptr_dtor(&EX_T(EX(call_opline)->result.u.var).var.ptr);
+ if (RETURN_VALUE_USED(EX(call_opline)) && EX_T(EX(call_opline)->result.var).var.ptr) {
+ zval_ptr_dtor(&EX_T(EX(call_opline)->result.var).var.ptr);
}
}
@@ -294,9 +294,9 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
EX(function_state).arguments = zend_vm_stack_push_args(opline->extended_value TSRMLS_CC);
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) {
- ALLOC_INIT_ZVAL(EX_T(opline->result.u.var).var.ptr);
- EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
- EX_T(opline->result.u.var).var.fcall_returned_reference = EX(function_state).function->common.return_reference;
+ ALLOC_INIT_ZVAL(EX_T(opline->result.var).var.ptr);
+ EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
+ EX_T(opline->result.var).var.fcall_returned_reference = EX(function_state).function->common.return_reference;
if (EX(function_state).function->common.arg_info) {
zend_uint i=0;
@@ -310,13 +310,13 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
}
if (!zend_execute_internal) {
/* saves one function call if zend_execute_internal is not used */
- ((zend_internal_function *) EX(function_state).function)->handler(opline->extended_value, EX_T(opline->result.u.var).var.ptr, EX(function_state).function->common.return_reference?&EX_T(opline->result.u.var).var.ptr:NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
+ ((zend_internal_function *) EX(function_state).function)->handler(opline->extended_value, EX_T(opline->result.var).var.ptr, EX(function_state).function->common.return_reference?&EX_T(opline->result.var).var.ptr:NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
} else {
zend_execute_internal(execute_data, RETURN_VALUE_USED(opline) TSRMLS_CC);
}
if (!RETURN_VALUE_USED(opline)) {
- zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
+ zval_ptr_dtor(&EX_T(opline->result.var).var.ptr);
}
} else if (EX(function_state).function->type == ZEND_USER_FUNCTION) {
EX(original_return_value) = EG(return_value_ptr_ptr);
@@ -324,10 +324,10 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
EG(active_op_array) = &EX(function_state).function->op_array;
EG(return_value_ptr_ptr) = NULL;
if (RETURN_VALUE_USED(opline)) {
- EG(return_value_ptr_ptr) = &EX_T(opline->result.u.var).var.ptr;
- EX_T(opline->result.u.var).var.ptr = NULL;
- EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
- EX_T(opline->result.u.var).var.fcall_returned_reference = EX(function_state).function->common.return_reference;
+ EG(return_value_ptr_ptr) = &EX_T(opline->result.var).var.ptr;
+ EX_T(opline->result.var).var.ptr = NULL;
+ EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
+ EX_T(opline->result.var).var.fcall_returned_reference = EX(function_state).function->common.return_reference;
}
if (zend_execute == execute && !EG(exception)) {
@@ -353,11 +353,11 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
}
EG(active_symbol_table) = EX(symbol_table);
} else { /* ZEND_OVERLOADED_FUNCTION */
- ALLOC_INIT_ZVAL(EX_T(opline->result.u.var).var.ptr);
+ ALLOC_INIT_ZVAL(EX_T(opline->result.var).var.ptr);
/* Not sure what should be done here if it's a static method */
if (EX(object)) {
- Z_OBJ_HT_P(EX(object))->call_method(EX(function_state).function->common.function_name, opline->extended_value, EX_T(opline->result.u.var).var.ptr, &EX_T(opline->result.u.var).var.ptr, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
+ Z_OBJ_HT_P(EX(object))->call_method(EX(function_state).function->common.function_name, opline->extended_value, EX_T(opline->result.var).var.ptr, &EX_T(opline->result.var).var.ptr, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
} else {
zend_error_noreturn(E_ERROR, "Cannot call overloaded function for non-object");
}
@@ -368,12 +368,12 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
efree(EX(function_state).function);
if (!RETURN_VALUE_USED(opline)) {
- zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
+ zval_ptr_dtor(&EX_T(opline->result.var).var.ptr);
} else {
- Z_UNSET_ISREF_P(EX_T(opline->result.u.var).var.ptr);
- Z_SET_REFCOUNT_P(EX_T(opline->result.u.var).var.ptr, 1);
- EX_T(opline->result.u.var).var.fcall_returned_reference = 0;
- EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
+ Z_UNSET_ISREF_P(EX_T(opline->result.var).var.ptr);
+ Z_SET_REFCOUNT_P(EX_T(opline->result.var).var.ptr, 1);
+ EX_T(opline->result.var).var.fcall_returned_reference = 0;
+ EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
}
}
@@ -404,8 +404,8 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
if (EG(exception)) {
zend_throw_exception_internal(NULL TSRMLS_CC);
- if (RETURN_VALUE_USED(opline) && EX_T(opline->result.u.var).var.ptr) {
- zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
+ if (RETURN_VALUE_USED(opline) && EX_T(opline->result.var).var.ptr) {
+ zval_ptr_dtor(&EX_T(opline->result.var).var.ptr);
}
}
@@ -421,7 +421,7 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER(ZEND_OPCODE_HANDLER
static int ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zend_uint arg_num = Z_LVAL(opline->op1.u.constant);
+ zend_uint arg_num = opline->op1.num;
zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC);
if (param == NULL) {
@@ -431,20 +431,20 @@ static int ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL, opline->extended_value TSRMLS_CC)) {
if(ptr && ptr->op_array) {
- zend_error(E_WARNING, "Missing argument %ld for %s%s%s(), called in %s on line %d and defined", opline->op1.u.constant.value.lval, class_name, space, get_active_function_name(TSRMLS_C), ptr->op_array->filename, ptr->opline->lineno);
+ zend_error(E_WARNING, "Missing argument %u for %s%s%s(), called in %s on line %d and defined", opline->op1.num, class_name, space, get_active_function_name(TSRMLS_C), ptr->op_array->filename, ptr->opline->lineno);
} else {
- zend_error(E_WARNING, "Missing argument %ld for %s%s%s()", opline->op1.u.constant.value.lval, class_name, space, get_active_function_name(TSRMLS_C));
+ zend_error(E_WARNING, "Missing argument %u for %s%s%s()", opline->op1.num, class_name, space, get_active_function_name(TSRMLS_C));
}
}
- if (opline->result.op_type == IS_VAR) {
- PZVAL_UNLOCK_FREE(*EX_T(opline->result.u.var).var.ptr_ptr);
+ if (opline->result_type == IS_VAR) {
+ PZVAL_UNLOCK_FREE(*EX_T(opline->result.var).var.ptr_ptr);
}
} else {
zend_free_op free_res;
zval **var_ptr;
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC);
- var_ptr = get_zval_ptr_ptr(&opline->result, EX(Ts), &free_res, BP_VAR_W);
+ var_ptr = get_zval_ptr_ptr(opline->result_type, &opline->result, EX(Ts), &free_res, BP_VAR_W);
Z_DELREF_PP(var_ptr);
*var_ptr = *param;
Z_ADDREF_PP(var_ptr);
@@ -459,32 +459,32 @@ static int ZEND_FASTCALL ZEND_NEW_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *object_zval;
zend_function *constructor;
- if (EX_T(opline->op1.u.var).class_entry->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) {
+ if (EX_T(opline->op1.var).class_entry->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) {
char *class_type;
- if (EX_T(opline->op1.u.var).class_entry->ce_flags & ZEND_ACC_INTERFACE) {
+ if (EX_T(opline->op1.var).class_entry->ce_flags & ZEND_ACC_INTERFACE) {
class_type = "interface";
} else {
class_type = "abstract class";
}
- zend_error_noreturn(E_ERROR, "Cannot instantiate %s %s", class_type, EX_T(opline->op1.u.var).class_entry->name);
+ zend_error_noreturn(E_ERROR, "Cannot instantiate %s %s", class_type, EX_T(opline->op1.var).class_entry->name);
}
ALLOC_ZVAL(object_zval);
- object_init_ex(object_zval, EX_T(opline->op1.u.var).class_entry);
+ object_init_ex(object_zval, EX_T(opline->op1.var).class_entry);
INIT_PZVAL(object_zval);
constructor = Z_OBJ_HT_P(object_zval)->get_constructor(object_zval TSRMLS_CC);
if (constructor == NULL) {
if (RETURN_VALUE_USED(opline)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, object_zval);
+ AI_SET_PTR(EX_T(opline->result.var).var, object_zval);
} else {
zval_ptr_dtor(&object_zval);
}
- ZEND_VM_JMP(EX(op_array)->opcodes + opline->op2.u.opline_num);
+ ZEND_VM_JMP(EX(op_array)->opcodes + opline->op2.opline_num);
} else {
if (RETURN_VALUE_USED(opline)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, object_zval);
+ AI_SET_PTR(EX_T(opline->result.var).var, object_zval);
PZVAL_LOCK(object_zval);
}
@@ -493,7 +493,7 @@ static int ZEND_FASTCALL ZEND_NEW_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
/* We are not handling overloaded classes right now */
EX(object) = object_zval;
EX(fbc) = constructor;
- EX(called_scope) = EX_T(opline->op1.u.var).class_entry;
+ EX(called_scope) = EX_T(opline->op1.var).class_entry;
ZEND_VM_NEXT_OPCODE();
}
@@ -503,10 +503,10 @@ static int ZEND_FASTCALL ZEND_BEGIN_SILENCE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_AR
{
zend_op *opline = EX(opline);
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = EG(error_reporting);
- Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG; /* shouldn't be necessary */
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = EG(error_reporting);
+ Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_LONG; /* shouldn't be necessary */
if (EX(old_error_reporting) == NULL) {
- EX(old_error_reporting) = &EX_T(opline->result.u.var).tmp_var;
+ EX(old_error_reporting) = &EX_T(opline->result.var).tmp_var;
}
if (EG(error_reporting)) {
@@ -549,7 +549,7 @@ static int ZEND_FASTCALL ZEND_DECLARE_CLASS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_AR
{
zend_op *opline = EX(opline);
- EX_T(opline->result.u.var).class_entry = do_bind_class(opline, EG(class_table), 0 TSRMLS_CC);
+ EX_T(opline->result.var).class_entry = do_bind_class(EX(op_array), opline, EG(class_table), 0 TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
}
@@ -557,7 +557,7 @@ static int ZEND_FASTCALL ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER(ZEND_OPCODE_
{
zend_op *opline = EX(opline);
- EX_T(opline->result.u.var).class_entry = do_bind_inherited_class(opline, EG(class_table), EX_T(opline->extended_value).class_entry, 0 TSRMLS_CC);
+ EX_T(opline->result.var).class_entry = do_bind_inherited_class(EX(op_array), opline, EG(class_table), EX_T(opline->extended_value).class_entry, 0 TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
}
@@ -566,17 +566,30 @@ static int ZEND_FASTCALL ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER(ZEND
zend_op *opline = EX(opline);
zend_class_entry **pce, **pce_orig;
- if (zend_hash_find(EG(class_table), Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant)+1, (void**)&pce) == FAILURE ||
- (zend_hash_find(EG(class_table), Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), (void**)&pce_orig) == SUCCESS &&
+ if (zend_hash_quick_find(EG(class_table), Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv)+1, Z_HASH_P(opline->op2.zv), (void**)&pce) == FAILURE ||
+ (zend_hash_quick_find(EG(class_table), Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), Z_HASH_P(opline->op1.zv), (void**)&pce_orig) == SUCCESS &&
*pce != *pce_orig)) {
- do_bind_inherited_class(opline, EG(class_table), EX_T(opline->extended_value).class_entry, 0 TSRMLS_CC);
+ do_bind_inherited_class(EX(op_array), opline, EG(class_table), EX_T(opline->extended_value).class_entry, 0 TSRMLS_CC);
}
ZEND_VM_NEXT_OPCODE();
}
static int ZEND_FASTCALL ZEND_DECLARE_FUNCTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- do_bind_function(EX(opline), EG(function_table), 0);
+ do_bind_function(EX(op_array), EX(opline), EG(function_table), 0);
+ ZEND_VM_NEXT_OPCODE();
+}
+
+static int ZEND_FASTCALL ZEND_TICKS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ zend_op *opline = EX(opline);
+
+ if (++EG(ticks_count)>=opline->extended_value) {
+ EG(ticks_count)=0;
+ if (zend_ticks_function) {
+ zend_ticks_function(opline->extended_value);
+ }
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -648,13 +661,13 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER
switch (brk_opline->opcode) {
case ZEND_SWITCH_FREE:
- if (brk_opline->op1.u.EA.type != EXT_TYPE_FREE_ON_RETURN) {
- zend_switch_free(&EX_T(brk_opline->op1.u.var), brk_opline->extended_value TSRMLS_CC);
+ if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) {
+ zend_switch_free(&EX_T(brk_opline->op1.var), brk_opline->extended_value TSRMLS_CC);
}
break;
case ZEND_FREE:
- if (brk_opline->op1.u.EA.type != EXT_TYPE_FREE_ON_RETURN) {
- zendi_zval_dtor(EX_T(brk_opline->op1.u.var).tmp_var);
+ if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) {
+ zendi_zval_dtor(EX_T(brk_opline->op1.var).tmp_var);
}
break;
}
@@ -682,7 +695,7 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER
static int ZEND_FASTCALL ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- zend_verify_abstract_class(EX_T(EX(opline)->op1.u.var).class_entry TSRMLS_CC);
+ zend_verify_abstract_class(EX_T(EX(opline)->op1.var).class_entry TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
}
@@ -712,16 +725,18 @@ static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLE
if (IS_CONST == IS_UNUSED) {
- EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC);
+ EX_T(opline->result.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
} else {
- zval *class_name = &opline->op2.u.constant;
+ zval *class_name = opline->op2.zv;
- if (IS_CONST != IS_CONST && Z_TYPE_P(class_name) == IS_OBJECT) {
- EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name);
+ if (IS_CONST == IS_CONST) {
+ EX_T(opline->result.var).class_entry = zend_fetch_class_by_name(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->op2.literal + 1, opline->extended_value TSRMLS_CC);
+ } else if (Z_TYPE_P(class_name) == IS_OBJECT) {
+ EX_T(opline->result.var).class_entry = Z_OBJCE_P(class_name);
} else if (Z_TYPE_P(class_name) == IS_STRING) {
- EX_T(opline->result.u.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC);
+ EX_T(opline->result.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC);
} else {
zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string");
}
@@ -741,11 +756,11 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
if (IS_CONST == IS_CONST) {
- if (zend_hash_quick_find(EG(function_table), Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant)+1, opline->extended_value, (void **) &EX(fbc)) == FAILURE) {
- zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL(opline->op2.u.constant));
+ if (zend_hash_quick_find(EG(function_table), Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv)+1, Z_HASH_P(opline->op1.zv), (void **) &EX(fbc)) == FAILURE) {
+ zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(opline->op2.zv));
}
} else {
- function_name = &opline->op2.u.constant;
+ function_name = opline->op2.zv;
if (IS_CONST != IS_CONST &&
Z_TYPE_P(function_name) == IS_OBJECT &&
@@ -790,10 +805,10 @@ static int ZEND_FASTCALL ZEND_INIT_NS_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPC
ZEND_VM_INC_OPCODE();
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
- if (zend_hash_quick_find(EG(function_table), Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant)+1, opline->extended_value, (void **) &EX(fbc))==FAILURE) {
- char *short_name = Z_STRVAL(opline->op1.u.constant)+Z_LVAL(op_data->op1.u.constant);
- if (zend_hash_quick_find(EG(function_table), short_name, Z_STRLEN(opline->op1.u.constant)-Z_LVAL(op_data->op1.u.constant)+1, op_data->extended_value, (void **) &EX(fbc))==FAILURE) {
- zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL(opline->op2.u.constant));
+ if (zend_hash_quick_find(EG(function_table), Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv)+1, Z_HASH_P(opline->op1.zv), (void **) &EX(fbc))==FAILURE) {
+ char *short_name = Z_STRVAL_P(opline->op1.zv)+op_data->op1.num;
+ if (zend_hash_quick_find(EG(function_table), short_name, Z_STRLEN_P(opline->op1.zv)-op_data->op1.num+1, op_data->extended_value, (void **) &EX(fbc))==FAILURE) {
+ zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(opline->op2.zv));
}
}
@@ -805,15 +820,16 @@ static int ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_
{
zend_op *opline = EX(opline);
zval *assignment_value;
- zend_uint arg_num = Z_LVAL(opline->op1.u.constant);
+ zend_uint arg_num = opline->op1.num;
zend_free_op free_res;
zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC);
zval **var_ptr;
if (param == NULL) {
ALLOC_ZVAL(assignment_value);
- *assignment_value = opline->op2.u.constant;
- if ((Z_TYPE(opline->op2.u.constant) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT || Z_TYPE(opline->op2.u.constant)==IS_CONSTANT_ARRAY) {
+ *assignment_value = *opline->op2.zv;
+ if ((Z_TYPE_P(assignment_value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT ||
+ Z_TYPE_P(assignment_value)==IS_CONSTANT_ARRAY) {
Z_SET_REFCOUNT_P(assignment_value, 1);
zval_update_constant(&assignment_value, 0 TSRMLS_CC);
} else {
@@ -826,7 +842,7 @@ static int ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_
}
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value TSRMLS_CC);
- var_ptr = get_zval_ptr_ptr(&opline->result, EX(Ts), &free_res, BP_VAR_W);
+ var_ptr = get_zval_ptr_ptr(opline->result_type, &opline->result, EX(Ts), &free_res, BP_VAR_W);
Z_DELREF_PP(var_ptr);
*var_ptr = assignment_value;
@@ -839,7 +855,7 @@ static int ZEND_FASTCALL ZEND_BRK_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_brk_cont_element *el;
- el = zend_brk_cont(&opline->op2.u.constant, opline->op1.u.opline_num,
+ el = zend_brk_cont(opline->op2.zv, opline->op1.opline_num,
EX(op_array), EX(Ts) TSRMLS_CC);
ZEND_VM_JMP(EX(op_array)->opcodes + el->brk);
@@ -851,7 +867,7 @@ static int ZEND_FASTCALL ZEND_CONT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_brk_cont_element *el;
- el = zend_brk_cont(&opline->op2.u.constant, opline->op1.u.opline_num,
+ el = zend_brk_cont(opline->op2.zv, opline->op1.opline_num,
EX(op_array), EX(Ts) TSRMLS_CC);
ZEND_VM_JMP(EX(op_array)->opcodes + el->cont);
@@ -863,31 +879,31 @@ static int ZEND_FASTCALL ZEND_GOTO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_op *opline = EX(opline);
zend_brk_cont_element *el;
- el = zend_brk_cont(&opline->op2.u.constant, opline->extended_value,
+ el = zend_brk_cont(opline->op2.zv, opline->extended_value,
EX(op_array), EX(Ts) TSRMLS_CC);
brk_opline = EX(op_array)->opcodes + el->brk;
switch (brk_opline->opcode) {
case ZEND_SWITCH_FREE:
- if (brk_opline->op1.u.EA.type != EXT_TYPE_FREE_ON_RETURN) {
- zend_switch_free(&EX_T(brk_opline->op1.u.var), brk_opline->extended_value TSRMLS_CC);
+ if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) {
+ zend_switch_free(&EX_T(brk_opline->op1.var), brk_opline->extended_value TSRMLS_CC);
}
break;
case ZEND_FREE:
- if (brk_opline->op1.u.EA.type != EXT_TYPE_FREE_ON_RETURN) {
- zendi_zval_dtor(EX_T(brk_opline->op1.u.var).tmp_var);
+ if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) {
+ zendi_zval_dtor(EX_T(brk_opline->op1.var).tmp_var);
}
break;
}
- ZEND_VM_JMP(opline->op1.u.jmp_addr);
+ ZEND_VM_JMP(opline->op1.jmp_addr);
}
static int ZEND_FASTCALL ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zend_class_entry *ce = EX_T(opline->op1.u.var).class_entry;
- zend_class_entry *iface = zend_fetch_class(Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant), opline->extended_value TSRMLS_CC);
+ zend_class_entry *ce = EX_T(opline->op1.var).class_entry;
+ zend_class_entry *iface = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, opline->extended_value TSRMLS_CC);
if (iface) {
if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) {
@@ -905,16 +921,18 @@ static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_
if (IS_TMP_VAR == IS_UNUSED) {
- EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC);
+ EX_T(opline->result.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
} else {
zend_free_op free_op2;
- zval *class_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
+ zval *class_name = _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC);
- if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(class_name) == IS_OBJECT) {
- EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name);
+ if (IS_TMP_VAR == IS_CONST) {
+ EX_T(opline->result.var).class_entry = zend_fetch_class_by_name(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->op2.literal + 1, opline->extended_value TSRMLS_CC);
+ } else if (Z_TYPE_P(class_name) == IS_OBJECT) {
+ EX_T(opline->result.var).class_entry = Z_OBJCE_P(class_name);
} else if (Z_TYPE_P(class_name) == IS_STRING) {
- EX_T(opline->result.u.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC);
+ EX_T(opline->result.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC);
} else {
zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string");
}
@@ -935,11 +953,11 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
if (IS_TMP_VAR == IS_CONST) {
- if (zend_hash_quick_find(EG(function_table), Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant)+1, opline->extended_value, (void **) &EX(fbc)) == FAILURE) {
- zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL(opline->op2.u.constant));
+ if (zend_hash_quick_find(EG(function_table), Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv)+1, Z_HASH_P(opline->op1.zv), (void **) &EX(fbc)) == FAILURE) {
+ zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(opline->op2.zv));
}
} else {
- function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
+ function_name = _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC);
if (IS_TMP_VAR != IS_CONST &&
Z_TYPE_P(function_name) == IS_OBJECT &&
@@ -982,7 +1000,7 @@ static int ZEND_FASTCALL ZEND_BRK_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_free_op free_op2;
zend_brk_cont_element *el;
- el = zend_brk_cont(_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC), opline->op1.u.opline_num,
+ el = zend_brk_cont(_get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC), opline->op1.opline_num,
EX(op_array), EX(Ts) TSRMLS_CC);
zval_dtor(free_op2.var);
ZEND_VM_JMP(EX(op_array)->opcodes + el->brk);
@@ -994,7 +1012,7 @@ static int ZEND_FASTCALL ZEND_CONT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_free_op free_op2;
zend_brk_cont_element *el;
- el = zend_brk_cont(_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC), opline->op1.u.opline_num,
+ el = zend_brk_cont(_get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC), opline->op1.opline_num,
EX(op_array), EX(Ts) TSRMLS_CC);
zval_dtor(free_op2.var);
ZEND_VM_JMP(EX(op_array)->opcodes + el->cont);
@@ -1006,16 +1024,18 @@ static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_
if (IS_VAR == IS_UNUSED) {
- EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC);
+ EX_T(opline->result.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
} else {
zend_free_op free_op2;
- zval *class_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
+ zval *class_name = _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC);
- if (IS_VAR != IS_CONST && Z_TYPE_P(class_name) == IS_OBJECT) {
- EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name);
+ if (IS_VAR == IS_CONST) {
+ EX_T(opline->result.var).class_entry = zend_fetch_class_by_name(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->op2.literal + 1, opline->extended_value TSRMLS_CC);
+ } else if (Z_TYPE_P(class_name) == IS_OBJECT) {
+ EX_T(opline->result.var).class_entry = Z_OBJCE_P(class_name);
} else if (Z_TYPE_P(class_name) == IS_STRING) {
- EX_T(opline->result.u.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC);
+ EX_T(opline->result.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC);
} else {
zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string");
}
@@ -1036,11 +1056,11 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
if (IS_VAR == IS_CONST) {
- if (zend_hash_quick_find(EG(function_table), Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant)+1, opline->extended_value, (void **) &EX(fbc)) == FAILURE) {
- zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL(opline->op2.u.constant));
+ if (zend_hash_quick_find(EG(function_table), Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv)+1, Z_HASH_P(opline->op1.zv), (void **) &EX(fbc)) == FAILURE) {
+ zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(opline->op2.zv));
}
} else {
- function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
+ function_name = _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC);
if (IS_VAR != IS_CONST &&
Z_TYPE_P(function_name) == IS_OBJECT &&
@@ -1083,7 +1103,7 @@ static int ZEND_FASTCALL ZEND_BRK_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_free_op free_op2;
zend_brk_cont_element *el;
- el = zend_brk_cont(_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC), opline->op1.u.opline_num,
+ el = zend_brk_cont(_get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC), opline->op1.opline_num,
EX(op_array), EX(Ts) TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_JMP(EX(op_array)->opcodes + el->brk);
@@ -1095,7 +1115,7 @@ static int ZEND_FASTCALL ZEND_CONT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_free_op free_op2;
zend_brk_cont_element *el;
- el = zend_brk_cont(_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC), opline->op1.u.opline_num,
+ el = zend_brk_cont(_get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC), opline->op1.opline_num,
EX(op_array), EX(Ts) TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_JMP(EX(op_array)->opcodes + el->cont);
@@ -1107,16 +1127,18 @@ static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDL
if (IS_UNUSED == IS_UNUSED) {
- EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC);
+ EX_T(opline->result.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
} else {
zval *class_name = NULL;
- if (IS_UNUSED != IS_CONST && Z_TYPE_P(class_name) == IS_OBJECT) {
- EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name);
+ if (IS_UNUSED == IS_CONST) {
+ EX_T(opline->result.var).class_entry = zend_fetch_class_by_name(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->op2.literal + 1, opline->extended_value TSRMLS_CC);
+ } else if (Z_TYPE_P(class_name) == IS_OBJECT) {
+ EX_T(opline->result.var).class_entry = Z_OBJCE_P(class_name);
} else if (Z_TYPE_P(class_name) == IS_STRING) {
- EX_T(opline->result.u.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC);
+ EX_T(opline->result.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC);
} else {
zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string");
}
@@ -1131,16 +1153,18 @@ static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_A
if (IS_CV == IS_UNUSED) {
- EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC);
+ EX_T(opline->result.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
} else {
- zval *class_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
+ zval *class_name = _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC);
- if (IS_CV != IS_CONST && Z_TYPE_P(class_name) == IS_OBJECT) {
- EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name);
+ if (IS_CV == IS_CONST) {
+ EX_T(opline->result.var).class_entry = zend_fetch_class_by_name(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->op2.literal + 1, opline->extended_value TSRMLS_CC);
+ } else if (Z_TYPE_P(class_name) == IS_OBJECT) {
+ EX_T(opline->result.var).class_entry = Z_OBJCE_P(class_name);
} else if (Z_TYPE_P(class_name) == IS_STRING) {
- EX_T(opline->result.u.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC);
+ EX_T(opline->result.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC);
} else {
zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string");
}
@@ -1160,11 +1184,11 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
if (IS_CV == IS_CONST) {
- if (zend_hash_quick_find(EG(function_table), Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant)+1, opline->extended_value, (void **) &EX(fbc)) == FAILURE) {
- zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL(opline->op2.u.constant));
+ if (zend_hash_quick_find(EG(function_table), Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv)+1, Z_HASH_P(opline->op1.zv), (void **) &EX(fbc)) == FAILURE) {
+ zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(opline->op2.zv));
}
} else {
- function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
+ function_name = _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC);
if (IS_CV != IS_CONST &&
Z_TYPE_P(function_name) == IS_OBJECT &&
@@ -1213,9 +1237,9 @@ static int ZEND_FASTCALL ZEND_CATCH_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ZEND_VM_CONTINUE(); /* CHECK_ME */
}
ce = Z_OBJCE_P(EG(exception));
- if (ce != EX_T(opline->op1.u.var).class_entry) {
- if (!instanceof_function(ce, EX_T(opline->op1.u.var).class_entry TSRMLS_CC)) {
- if (opline->op1.u.EA.type) {
+ if (ce != EX_T(opline->op1.var).class_entry) {
+ if (!instanceof_function(ce, EX_T(opline->op1.var).class_entry TSRMLS_CC)) {
+ if (opline->result.num) {
zend_throw_exception_internal(NULL TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
}
@@ -1225,15 +1249,15 @@ static int ZEND_FASTCALL ZEND_CATCH_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
if (!EG(active_symbol_table)) {
- if (EX(CVs)[opline->op2.u.var]) {
- zval_ptr_dtor(EX(CVs)[opline->op2.u.var]);
+ if (EX(CVs)[opline->op2.var]) {
+ zval_ptr_dtor(EX(CVs)[opline->op2.var]);
}
- EX(CVs)[opline->op2.u.var] = (zval**)EX(CVs) + (EX(op_array)->last_var + opline->op2.u.var);
- *EX(CVs)[opline->op2.u.var] = EG(exception);
+ EX(CVs)[opline->op2.var] = (zval**)EX(CVs) + (EX(op_array)->last_var + opline->op2.var);
+ *EX(CVs)[opline->op2.var] = EG(exception);
} else {
- zend_compiled_variable *cv = &CV_DEF_OF(opline->op2.u.var);
+ zend_compiled_variable *cv = &CV_DEF_OF(opline->op2.var);
zend_hash_quick_update(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value,
- &EG(exception), sizeof(zval *), (void**)&EX(CVs)[opline->op2.u.var]);
+ &EG(exception), sizeof(zval *), (void**)&EX(CVs)[opline->op2.var]);
}
EG(exception) = NULL;
ZEND_VM_NEXT_OPCODE();
@@ -1245,7 +1269,7 @@ static int ZEND_FASTCALL ZEND_BRK_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_brk_cont_element *el;
- el = zend_brk_cont(_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC), opline->op1.u.opline_num,
+ el = zend_brk_cont(_get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC), opline->op1.opline_num,
EX(op_array), EX(Ts) TSRMLS_CC);
ZEND_VM_JMP(EX(op_array)->opcodes + el->brk);
@@ -1257,7 +1281,7 @@ static int ZEND_FASTCALL ZEND_CONT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_brk_cont_element *el;
- el = zend_brk_cont(_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC), opline->op1.u.opline_num,
+ el = zend_brk_cont(_get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC), opline->op1.opline_num,
EX(op_array), EX(Ts) TSRMLS_CC);
ZEND_VM_JMP(EX(op_array)->opcodes + el->cont);
@@ -1268,8 +1292,8 @@ static int ZEND_FASTCALL ZEND_BW_NOT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_op *opline = EX(opline);
- bitwise_not_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant TSRMLS_CC);
+ bitwise_not_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
}
@@ -1279,8 +1303,8 @@ static int ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
zend_op *opline = EX(opline);
- boolean_not_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant TSRMLS_CC);
+ boolean_not_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
}
@@ -1290,7 +1314,7 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_op *opline = EX(opline);
zval z_copy;
- zval *z = &opline->op1.u.constant;
+ zval *z = opline->op1.zv;
if (IS_CONST != IS_CONST &&
Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL &&
@@ -1308,8 +1332,8 @@ static int ZEND_FASTCALL ZEND_PRINT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
{
zend_op *opline = EX(opline);
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1;
- Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG;
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = 1;
+ Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_LONG;
return ZEND_ECHO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
@@ -1318,10 +1342,11 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST(int type, ZEND
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *varname = &opline->op1.u.constant;
+ zval *varname = opline->op1.zv;
zval **retval;
zval tmp_varname;
HashTable *target_symbol_table;
+ ulong hash_value;
if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
tmp_varname = *varname;
@@ -1330,17 +1355,23 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST(int type, ZEND
varname = &tmp_varname;
}
- if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
- retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC);
+ if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC_MEMBER) {
+ retval = zend_std_get_static_property(EX_T(opline->op2.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((IS_CONST == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
} else {
- target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
/*
if (!target_symbol_table) {
ZEND_VM_NEXT_OPCODE();
}
*/
- if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &retval) == FAILURE) {
+ if (IS_CONST == IS_CONST) {
+ hash_value = Z_HASH_P(varname);
+ } else {
+ hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
+ }
+
+ if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
switch (type) {
case BP_VAR_R:
case BP_VAR_UNSET:
@@ -1356,13 +1387,13 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST(int type, ZEND
zval *new_zval = &EG(uninitialized_zval);
Z_ADDREF_P(new_zval);
- zend_hash_update(target_symbol_table, varname->value.str.val, varname->value.str.len+1, &new_zval, sizeof(zval *), (void **) &retval);
+ zend_hash_quick_update(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, &new_zval, sizeof(zval *), (void **) &retval);
}
break;
EMPTY_SWITCH_DEFAULT_CASE()
}
}
- switch (opline->op2.u.EA.type) {
+ switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) {
case ZEND_FETCH_GLOBAL:
if (IS_CONST != IS_TMP_VAR) {
@@ -1376,7 +1407,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST(int type, ZEND
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_CONST == IS_VAR && !free_op1.var) {
- PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr);
+ PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
}
break;
}
@@ -1386,7 +1417,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST(int type, ZEND
if (IS_CONST != IS_CONST && varname == &tmp_varname) {
zval_dtor(varname);
}
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
+ if (RETURN_VALUE_USED(opline)) {
if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
SEPARATE_ZVAL_TO_MAKE_IS_REF(retval);
}
@@ -1394,21 +1425,21 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST(int type, ZEND
switch (type) {
case BP_VAR_R:
case BP_VAR_IS:
- AI_SET_PTR(EX_T(opline->result.u.var).var, *retval);
+ AI_SET_PTR(EX_T(opline->result.var).var, *retval);
break;
case BP_VAR_UNSET: {
zend_free_op free_res;
- EX_T(opline->result.u.var).var.ptr_ptr = retval;
- PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res);
- if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
- SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr);
+ EX_T(opline->result.var).var.ptr_ptr = retval;
+ PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res);
+ if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
+ SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.var).var.ptr_ptr);
}
- PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr);
+ PZVAL_LOCK(*EX_T(opline->result.var).var.ptr_ptr);
FREE_OP_VAR_PTR(free_res);
break;
default:
- EX_T(opline->result.u.var).var.ptr_ptr = retval;
+ EX_T(opline->result.var).var.ptr_ptr = retval;
break;
}
}
@@ -1433,7 +1464,7 @@ static int ZEND_FASTCALL ZEND_FETCH_RW_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- return zend_fetch_var_address_helper_SPEC_CONST(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), EX(opline)->extended_value)?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ return zend_fetch_var_address_helper_SPEC_CONST(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (EX(opline)->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -1450,7 +1481,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zval *val = &opline->op1.u.constant;
+ zval *val = opline->op1.zv;
int ret;
if (IS_CONST == IS_TMP_VAR && Z_TYPE_P(val) == IS_BOOL) {
@@ -1464,9 +1495,9 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
if (!ret) {
#if DEBUG_ZEND>=2
- printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
+ printf("Conditional jmp to %d\n", opline->op2.opline_num);
#endif
- ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr);
+ ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
ZEND_VM_CONTINUE();
}
@@ -1477,7 +1508,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
{
zend_op *opline = EX(opline);
- zval *val = &opline->op1.u.constant;
+ zval *val = opline->op1.zv;
int ret;
if (IS_CONST == IS_TMP_VAR && Z_TYPE_P(val) == IS_BOOL) {
@@ -1491,9 +1522,9 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
}
if (ret) {
#if DEBUG_ZEND>=2
- printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
+ printf("Conditional jmp to %d\n", opline->op2.opline_num);
#endif
- ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr);
+ ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
ZEND_VM_CONTINUE();
}
@@ -1504,7 +1535,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
{
zend_op *opline = EX(opline);
- zval *val = &opline->op1.u.constant;
+ zval *val = opline->op1.zv;
int retval;
if (IS_CONST == IS_TMP_VAR && Z_TYPE_P(val) == IS_BOOL) {
@@ -1524,9 +1555,9 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZEND_VM_CONTINUE(); /* CHECK_ME */
} else {
#if DEBUG_ZEND>=2
- printf("Conditional jmp on false to %d\n", opline->op2.u.opline_num);
+ printf("Conditional jmp on false to %d\n", opline->op2.opline_num);
#endif
- ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.u.opline_num]);
+ ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]);
ZEND_VM_CONTINUE(); /* CHECK_ME */
}
}
@@ -1535,7 +1566,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
{
zend_op *opline = EX(opline);
- zval *val = &opline->op1.u.constant;
+ zval *val = opline->op1.zv;
int retval;
if (IS_CONST == IS_TMP_VAR && Z_TYPE_P(val) == IS_BOOL) {
@@ -1547,13 +1578,13 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
ZEND_VM_CONTINUE();
}
}
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval;
- Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = retval;
+ Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
if (!retval) {
#if DEBUG_ZEND>=2
- printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
+ printf("Conditional jmp to %d\n", opline->op2.opline_num);
#endif
- ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr);
+ ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
ZEND_VM_CONTINUE();
}
ZEND_VM_NEXT_OPCODE();
@@ -1563,7 +1594,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
{
zend_op *opline = EX(opline);
- zval *val = &opline->op1.u.constant;
+ zval *val = opline->op1.zv;
int retval;
if (IS_CONST == IS_TMP_VAR && Z_TYPE_P(val) == IS_BOOL) {
@@ -1575,13 +1606,13 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
ZEND_VM_CONTINUE();
}
}
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval;
- Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = retval;
+ Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
if (retval) {
#if DEBUG_ZEND>=2
- printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
+ printf("Conditional jmp to %d\n", opline->op2.opline_num);
#endif
- ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr);
+ ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
ZEND_VM_CONTINUE();
}
ZEND_VM_NEXT_OPCODE();
@@ -1591,11 +1622,11 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
{
zend_op *opline = EX(opline);
- zval *fname = &opline->op1.u.constant;
+ zval *fname = opline->op1.zv;
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
- if (zend_hash_quick_find(EG(function_table), fname->value.str.val, fname->value.str.len+1, Z_LVAL(opline->op2.u.constant), (void **) &EX(function_state).function)==FAILURE) {
+ if (zend_hash_quick_find(EG(function_table), Z_STRVAL_P(fname), Z_STRLEN_P(fname)+1, Z_HASH_P(fname), (void **) &EX(function_state).function)==FAILURE) {
zend_error_noreturn(E_ERROR, "Call to undefined function %s()", fname->value.str.val);
}
EX(object) = NULL;
@@ -1626,8 +1657,8 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
if (IS_CONST == IS_VAR && !Z_ISREF_PP(retval_ptr_ptr)) {
if (opline->extended_value == ZEND_RETURNS_FUNCTION &&
- EX_T(opline->op1.u.var).var.fcall_returned_reference) {
- } else if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) {
+ EX_T(opline->op1.var).var.fcall_returned_reference) {
+ } else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) {
if (IS_CONST == IS_VAR && !0) {
PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
}
@@ -1645,7 +1676,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
} else {
return_by_value:
- retval_ptr = &opline->op1.u.constant;
+ retval_ptr = opline->op1.zv;
if (!EG(return_value_ptr_ptr)) {
if (IS_CONST == IS_TMP_VAR) {
@@ -1684,7 +1715,7 @@ static int ZEND_FASTCALL ZEND_THROW_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zval *exception;
- value = &opline->op1.u.constant;
+ value = opline->op1.zv;
if (IS_CONST == IS_CONST || Z_TYPE_P(value) != IS_OBJECT) {
zend_error_noreturn(E_ERROR, "Can only throw objects");
@@ -1707,15 +1738,15 @@ static int ZEND_FASTCALL ZEND_SEND_VAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
{
zend_op *opline = EX(opline);
if (opline->extended_value==ZEND_DO_FCALL_BY_NAME
- && ARG_MUST_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
- zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.u.opline_num);
+ && ARG_MUST_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
+ zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.opline_num);
}
{
zval *valptr;
zval *value;
- value = &opline->op1.u.constant;
+ value = opline->op1.zv;
ALLOC_ZVAL(valptr);
INIT_PZVAL_COPY(valptr, value);
@@ -1734,8 +1765,8 @@ static int ZEND_FASTCALL ZEND_BOOL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
/* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = i_zend_is_true(&opline->op1.u.constant);
- Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = i_zend_is_true(opline->op1.zv);
+ Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
ZEND_VM_NEXT_OPCODE();
}
@@ -1744,7 +1775,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
{
zend_op *opline = EX(opline);
- zval *obj = &opline->op1.u.constant;
+ zval *obj = opline->op1.zv;
zend_class_entry *ce;
zend_function *clone;
zend_object_clone_obj_t clone_call;
@@ -1782,15 +1813,15 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
}
}
- EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
+ EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
if (!EG(exception)) {
- ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
- Z_OBJVAL_P(EX_T(opline->result.u.var).var.ptr) = clone_call(obj TSRMLS_CC);
- Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_OBJECT;
- Z_SET_REFCOUNT_P(EX_T(opline->result.u.var).var.ptr, 1);
- Z_SET_ISREF_P(EX_T(opline->result.u.var).var.ptr);
+ ALLOC_ZVAL(EX_T(opline->result.var).var.ptr);
+ Z_OBJVAL_P(EX_T(opline->result.var).var.ptr) = clone_call(obj TSRMLS_CC);
+ Z_TYPE_P(EX_T(opline->result.var).var.ptr) = IS_OBJECT;
+ Z_SET_REFCOUNT_P(EX_T(opline->result.var).var.ptr, 1);
+ Z_SET_ISREF_P(EX_T(opline->result.var).var.ptr);
if (!RETURN_VALUE_USED(opline) || EG(exception)) {
- zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
+ zval_ptr_dtor(&EX_T(opline->result.var).var.ptr);
}
}
@@ -1801,8 +1832,8 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zval *expr = &opline->op1.u.constant;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *expr = opline->op1.zv;
+ zval *result = &EX_T(opline->result.var).tmp_var;
if (opline->extended_value != IS_STRING) {
*result = *expr;
@@ -1858,7 +1889,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
zend_op_array *new_op_array=NULL;
int return_value_used;
- zval *inc_filename = &opline->op1.u.constant;
+ zval *inc_filename = opline->op1.zv;
zval tmp_inc_filename;
zend_bool failure_retval=0;
@@ -1871,7 +1902,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
return_value_used = RETURN_VALUE_USED(opline);
- switch (Z_LVAL(opline->op2.u.constant)) {
+ switch (opline->extended_value) {
case ZEND_INCLUDE_ONCE:
case ZEND_REQUIRE_ONCE: {
zend_file_handle file_handle;
@@ -1893,14 +1924,14 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
}
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
- new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
+ new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
zend_destroy_file_handle(&file_handle TSRMLS_CC);
} else {
zend_file_handle_dtor(&file_handle TSRMLS_CC);
failure_retval=1;
}
} else {
- if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) {
+ if (opline->extended_value == ZEND_INCLUDE_ONCE) {
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
} else {
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
@@ -1913,7 +1944,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
break;
case ZEND_INCLUDE:
case ZEND_REQUIRE:
- new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC);
+ new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
break;
case ZEND_EVAL: {
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
@@ -1928,12 +1959,12 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
zval_dtor(&tmp_inc_filename);
}
- EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
+ EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
if (new_op_array && !EG(exception)) {
EX(original_return_value) = EG(return_value_ptr_ptr);
- EG(return_value_ptr_ptr) = return_value_used ? EX_T(opline->result.u.var).var.ptr_ptr : NULL;
+ EG(return_value_ptr_ptr) = return_value_used ? EX_T(opline->result.var).var.ptr_ptr : NULL;
EG(active_op_array) = new_op_array;
- EX_T(opline->result.u.var).var.ptr = NULL;
+ EX_T(opline->result.var).var.ptr = NULL;
EX(current_object) = EX(object);
@@ -1955,11 +1986,11 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
EX(object) = EX(current_object);
if (return_value_used) {
- if (!EX_T(opline->result.u.var).var.ptr) { /* there was no return statement */
- ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
- INIT_PZVAL(EX_T(opline->result.u.var).var.ptr);
- Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = 1;
- Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL;
+ if (!EX_T(opline->result.var).var.ptr) { /* there was no return statement */
+ ALLOC_ZVAL(EX_T(opline->result.var).var.ptr);
+ INIT_PZVAL(EX_T(opline->result.var).var.ptr);
+ Z_LVAL_P(EX_T(opline->result.var).var.ptr) = 1;
+ Z_TYPE_P(EX_T(opline->result.var).var.ptr) = IS_BOOL;
}
}
@@ -1973,10 +2004,10 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
}
} else {
if (return_value_used) {
- ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
- INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr);
- Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = failure_retval;
- Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL;
+ ALLOC_ZVAL(EX_T(opline->result.var).var.ptr);
+ INIT_ZVAL(*EX_T(opline->result.var).var.ptr);
+ Z_LVAL_P(EX_T(opline->result.var).var.ptr) = failure_retval;
+ Z_TYPE_P(EX_T(opline->result.var).var.ptr) = IS_BOOL;
}
}
ZEND_VM_NEXT_OPCODE();
@@ -1992,7 +2023,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_
if (IS_CONST == IS_CV && (opline->extended_value & ZEND_QUICK_SET)) {
if (EG(active_symbol_table)) {
zend_execute_data *ex = EX(prev_execute_data);
- zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.u.var);
+ zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
if (zend_hash_quick_del(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value) == SUCCESS) {
while (ex && ex->symbol_table == EG(active_symbol_table)) {
@@ -2011,17 +2042,17 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_
ex = ex->prev_execute_data;
}
}
- EX(CVs)[opline->op1.u.var] = NULL;
- } else if (EX(CVs)[opline->op1.u.var]) {
- zval_ptr_dtor(EX(CVs)[opline->op1.u.var]);
- EX(CVs)[opline->op1.u.var] = NULL;
+ EX(CVs)[opline->op1.var] = NULL;
+ } else if (EX(CVs)[opline->op1.var]) {
+ zval_ptr_dtor(EX(CVs)[opline->op1.var]);
+ EX(CVs)[opline->op1.var] = NULL;
}
ZEND_VM_NEXT_OPCODE();
}
- varname = &opline->op1.u.constant;
+ varname = opline->op1.zv;
- if (Z_TYPE_P(varname) != IS_STRING) {
+ if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
tmp = *varname;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
@@ -2030,12 +2061,12 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_
Z_ADDREF_P(varname);
}
- if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
- zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname) TSRMLS_CC);
+ if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC_MEMBER) {
+ zend_std_unset_static_property(EX_T(opline->op2.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_CONST == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
} else {
ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
- target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
if (zend_hash_quick_del(target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value) == SUCCESS) {
zend_execute_data *ex = execute_data;
@@ -2083,7 +2114,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
} else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) {
if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) {
zend_error(E_WARNING, "foreach() cannot iterate over objects without PHP class");
- ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
+ ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
}
ce = Z_OBJCE_PP(array_ptr_ptr);
@@ -2103,7 +2134,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
Z_ADDREF_P(array_ptr);
}
} else {
- array_ptr = &opline->op1.u.constant;
+ array_ptr = opline->op1.zv;
if (0) { /* IS_TMP_VAR */
zval *tmp;
@@ -2155,7 +2186,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
}
}
- AI_SET_PTR(EX_T(opline->result.u.var).var, array_ptr);
+ AI_SET_PTR(EX_T(opline->result.var).var, array_ptr);
PZVAL_LOCK(array_ptr);
if (iter) {
@@ -2205,7 +2236,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
}
}
is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS;
- zend_hash_get_pointer(fe_ht, &EX_T(opline->result.u.var).fe.fe_pos);
+ zend_hash_get_pointer(fe_ht, &EX_T(opline->result.var).fe.fe_pos);
} else {
zend_error(E_WARNING, "Invalid argument supplied for foreach()");
is_empty = 1;
@@ -2217,7 +2248,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
}
if (is_empty) {
- ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
+ ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
} else {
ZEND_VM_NEXT_OPCODE();
}
@@ -2230,10 +2261,10 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_
zend_bool isset = 1;
if (IS_CONST == IS_CV && (opline->extended_value & ZEND_QUICK_SET)) {
- if (EX(CVs)[opline->op1.u.var]) {
- value = EX(CVs)[opline->op1.u.var];
+ if (EX(CVs)[opline->op1.var]) {
+ value = EX(CVs)[opline->op1.var];
} else if (EG(active_symbol_table)) {
- zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.u.var);
+ zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
isset = 0;
@@ -2244,22 +2275,22 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_
} else {
HashTable *target_symbol_table;
- zval tmp, *varname = &opline->op1.u.constant;
+ zval tmp, *varname = opline->op1.zv;
- if (Z_TYPE_P(varname) != IS_STRING) {
+ if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
tmp = *varname;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
varname = &tmp;
}
- if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
- value = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1 TSRMLS_CC);
+ if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC_MEMBER) {
+ value = zend_std_get_static_property(EX_T(opline->op2.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1, ((IS_CONST == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
if (!value) {
isset = 0;
}
} else {
- target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) {
isset = 0;
}
@@ -2271,23 +2302,20 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_
}
- Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
+ Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
- switch (opline->extended_value & ZEND_ISSET_ISEMPTY_MASK) {
- case ZEND_ISSET:
- if (isset && Z_TYPE_PP(value) == IS_NULL) {
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0;
- } else {
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = isset;
- }
- break;
- case ZEND_ISEMPTY:
- if (!isset || !i_zend_is_true(*value)) {
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1;
- } else {
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0;
- }
- break;
+ if (opline->extended_value & ZEND_ISSET) {
+ if (isset && Z_TYPE_PP(value) == IS_NULL) {
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = 0;
+ } else {
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = isset;
+ }
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (!isset || !i_zend_is_true(*value)) {
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = 1;
+ } else {
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = 0;
+ }
}
ZEND_VM_NEXT_OPCODE();
@@ -2299,7 +2327,7 @@ static int ZEND_FASTCALL ZEND_EXIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_op *opline = EX(opline);
if (IS_CONST != IS_UNUSED) {
- zval *ptr = &opline->op1.u.constant;
+ zval *ptr = opline->op1.zv;
if (Z_TYPE_P(ptr) == IS_LONG) {
EG(exit_status) = Z_LVAL_P(ptr);
@@ -2317,16 +2345,16 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
{
zend_op *opline = EX(opline);
- zval *value = &opline->op1.u.constant;
+ zval *value = opline->op1.zv;
if (i_zend_is_true(value)) {
- EX_T(opline->result.u.var).tmp_var = *value;
- zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var);
+ EX_T(opline->result.var).tmp_var = *value;
+ zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var);
#if DEBUG_ZEND>=2
- printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
+ printf("Conditional jmp to %d\n", opline->op2.opline_num);
#endif
- ZEND_VM_JMP(opline->op2.u.jmp_addr);
+ ZEND_VM_JMP(opline->op2.jmp_addr);
}
ZEND_VM_NEXT_OPCODE();
@@ -2336,37 +2364,24 @@ static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_
{
zend_op *opline = EX(opline);
- zval *value = &opline->op1.u.constant;
+ zval *value = opline->op1.zv;
- EX_T(opline->result.u.var).tmp_var = *value;
+ EX_T(opline->result.var).tmp_var = *value;
if (!0) {
- zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var);
+ zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
}
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL ZEND_TICKS_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
-{
- zend_op *opline = EX(opline);
-
- if (++EG(ticks_count)>=Z_LVAL(opline->op1.u.constant)) {
- EG(ticks_count)=0;
- if (zend_ticks_function) {
- zend_ticks_function(Z_LVAL(opline->op1.u.constant));
- }
- }
- ZEND_VM_NEXT_OPCODE();
-}
-
static int ZEND_FASTCALL ZEND_ADD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- add_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- &opline->op2.u.constant TSRMLS_CC);
+ add_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ opline->op2.zv TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -2377,9 +2392,9 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_
zend_op *opline = EX(opline);
- sub_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- &opline->op2.u.constant TSRMLS_CC);
+ sub_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ opline->op2.zv TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -2390,9 +2405,9 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_
zend_op *opline = EX(opline);
- mul_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- &opline->op2.u.constant TSRMLS_CC);
+ mul_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ opline->op2.zv TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -2403,9 +2418,9 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_
zend_op *opline = EX(opline);
- div_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- &opline->op2.u.constant TSRMLS_CC);
+ div_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ opline->op2.zv TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -2416,9 +2431,9 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_
zend_op *opline = EX(opline);
- mod_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- &opline->op2.u.constant TSRMLS_CC);
+ mod_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ opline->op2.zv TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -2429,9 +2444,9 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
zend_op *opline = EX(opline);
- shift_left_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- &opline->op2.u.constant TSRMLS_CC);
+ shift_left_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ opline->op2.zv TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -2442,9 +2457,9 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
zend_op *opline = EX(opline);
- shift_right_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- &opline->op2.u.constant TSRMLS_CC);
+ shift_right_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ opline->op2.zv TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -2455,9 +2470,9 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDL
zend_op *opline = EX(opline);
- concat_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- &opline->op2.u.constant TSRMLS_CC);
+ concat_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ opline->op2.zv TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -2468,9 +2483,9 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE
zend_op *opline = EX(opline);
- is_identical_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- &opline->op2.u.constant TSRMLS_CC);
+ is_identical_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ opline->op2.zv TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -2480,11 +2495,11 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OP
{
zend_op *opline = EX(opline);
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
is_identical_function(result,
- &opline->op1.u.constant,
- &opline->op2.u.constant TSRMLS_CC);
+ opline->op1.zv,
+ opline->op2.zv TSRMLS_CC);
Z_LVAL_P(result) = !Z_LVAL_P(result);
@@ -2495,11 +2510,11 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HAN
{
zend_op *opline = EX(opline);
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- &opline->op1.u.constant,
- &opline->op2.u.constant TSRMLS_CC);
+ opline->op1.zv,
+ opline->op2.zv TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) == 0));
@@ -2510,11 +2525,11 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE
{
zend_op *opline = EX(opline);
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- &opline->op1.u.constant,
- &opline->op2.u.constant TSRMLS_CC);
+ opline->op1.zv,
+ opline->op2.zv TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) != 0));
@@ -2525,11 +2540,11 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_H
{
zend_op *opline = EX(opline);
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- &opline->op1.u.constant,
- &opline->op2.u.constant TSRMLS_CC);
+ opline->op1.zv,
+ opline->op2.zv TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) < 0));
@@ -2540,11 +2555,11 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND
{
zend_op *opline = EX(opline);
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- &opline->op1.u.constant,
- &opline->op2.u.constant TSRMLS_CC);
+ opline->op1.zv,
+ opline->op2.zv TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) <= 0));
@@ -2556,9 +2571,9 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLE
zend_op *opline = EX(opline);
- bitwise_or_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- &opline->op2.u.constant TSRMLS_CC);
+ bitwise_or_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ opline->op2.zv TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -2569,9 +2584,9 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDL
zend_op *opline = EX(opline);
- bitwise_and_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- &opline->op2.u.constant TSRMLS_CC);
+ bitwise_and_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ opline->op2.zv TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -2582,9 +2597,9 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDL
zend_op *opline = EX(opline);
- bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- &opline->op2.u.constant TSRMLS_CC);
+ bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ opline->op2.zv TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -2595,9 +2610,9 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HAN
zend_op *opline = EX(opline);
- boolean_xor_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- &opline->op2.u.constant TSRMLS_CC);
+ boolean_xor_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ opline->op2.zv TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -2607,19 +2622,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_TMP_VAR_SPEC_CONST_CONST_HANDLER(ZEND_O
{
zend_op *opline = EX(opline);
- zval *container = &opline->op1.u.constant;
+ zval *container = opline->op1.zv;
if (Z_TYPE_P(container) != IS_ARRAY) {
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, EG(uninitialized_zval_ptr));
+ if (RETURN_VALUE_USED(opline)) {
+ AI_SET_PTR(EX_T(opline->result.var).var, EG(uninitialized_zval_ptr));
PZVAL_LOCK(EG(uninitialized_zval_ptr));
}
} else {
- zval *dim = &opline->op2.u.constant;
+ zval *dim = opline->op2.zv;
- AI_SET_PTR(EX_T(opline->result.u.var).var, *zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, BP_VAR_R TSRMLS_CC));
- SELECTIVE_PZVAL_LOCK(EX_T(opline->result.u.var).var.ptr, &opline->result);
+ AI_SET_PTR(EX_T(opline->result.var).var, *zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, IS_CONST, BP_VAR_R TSRMLS_CC));
+ SELECTIVE_PZVAL_LOCK(EX_T(opline->result.var).var.ptr, opline);
}
ZEND_VM_NEXT_OPCODE();
@@ -2635,15 +2650,15 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(
if (IS_CONST == IS_CONST) {
/* no function found. try a static method in class */
- ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
if (!ce) {
- zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL(opline->op1.u.constant));
+ zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
}
EX(called_scope) = ce;
} else {
- ce = EX_T(opline->op1.u.var).class_entry;
+ ce = EX_T(opline->op1.var).class_entry;
- if (opline->op1.u.EA.type == ZEND_FETCH_CLASS_PARENT || opline->op1.u.EA.type == ZEND_FETCH_CLASS_SELF) {
+ if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) {
EX(called_scope) = EG(called_scope);
} else {
EX(called_scope) = ce;
@@ -2655,10 +2670,10 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(
if (IS_CONST == IS_CONST) {
- function_name_strval = Z_STRVAL(opline->op2.u.constant);
- function_name_strlen = Z_STRLEN(opline->op2.u.constant);
+ function_name_strval = Z_STRVAL_P(opline->op2.zv);
+ function_name_strlen = Z_STRLEN_P(opline->op2.zv);
} else {
- function_name = &opline->op2.u.constant;
+ function_name = opline->op2.zv;
if (Z_TYPE_P(function_name) != IS_STRING) {
zend_error_noreturn(E_ERROR, "Function name must be a string");
@@ -2672,7 +2687,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(
if (ce->get_static_method) {
EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
} else {
- EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+ EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_CONST == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
}
if (!EX(fbc)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval);
@@ -2729,16 +2744,16 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER
if (IS_CONST==IS_VAR) {
- if (EX_T(opline->op1.u.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr);
+ if (EX_T(opline->op1.var).var.ptr_ptr) {
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
} else {
switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.u.var).str_offset.str);
+ Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
}
}
- is_equal_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- &opline->op2.u.constant TSRMLS_CC);
+ is_equal_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ opline->op2.zv TSRMLS_CC);
if (switch_expr_is_overloaded) {
/* We only free op1 if this is a string offset,
@@ -2747,8 +2762,8 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER
* are allocated at each get_zval_ptr())
*/
- EX_T(opline->op1.u.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.u.var).var.ptr = NULL;
+ EX_T(opline->op1.var).var.ptr_ptr = NULL;
+ EX_T(opline->op1.var).var.ptr = NULL;
}
ZEND_VM_NEXT_OPCODE();
}
@@ -2759,20 +2774,20 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
if (IS_CONST == IS_UNUSED) {
/* namespaced constant */
- if (!zend_get_constant_ex(Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant), &EX_T(opline->result.u.var).tmp_var, NULL, opline->extended_value TSRMLS_CC)) {
+ if (!zend_get_constant_ex(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), &EX_T(opline->result.var).tmp_var, NULL, opline->extended_value TSRMLS_CC)) {
if ((opline->extended_value & IS_CONSTANT_UNQUALIFIED) != 0) {
- char *actual = (char *)zend_memrchr(Z_STRVAL(opline->op2.u.constant), '\\', Z_STRLEN(opline->op2.u.constant));
+ char *actual = (char *)zend_memrchr(Z_STRVAL_P(opline->op2.zv), '\\', Z_STRLEN_P(opline->op2.zv));
if(!actual) {
- actual = Z_STRVAL(opline->op2.u.constant);
+ actual = Z_STRVAL_P(opline->op2.zv);
} else {
actual++;
}
/* non-qualified constant - allow text substitution */
zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", actual, actual);
- ZVAL_STRINGL(&EX_T(opline->result.u.var).tmp_var, actual, Z_STRLEN(opline->op2.u.constant)-(actual - Z_STRVAL(opline->op2.u.constant)), 1);
+ ZVAL_STRINGL(&EX_T(opline->result.var).tmp_var, actual, Z_STRLEN_P(opline->op2.zv)-(actual - Z_STRVAL_P(opline->op2.zv)), 1);
} else {
zend_error_noreturn(E_ERROR, "Undefined constant '%s'",
- Z_STRVAL(opline->op2.u.constant), Z_STRVAL(opline->op2.u.constant));
+ Z_STRVAL_P(opline->op2.zv), Z_STRVAL_P(opline->op2.zv));
}
}
ZEND_VM_NEXT_OPCODE();
@@ -2783,15 +2798,15 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
if (IS_CONST == IS_CONST) {
- ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
if (!ce) {
- zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL(opline->op2.u.constant));
+ zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv));
}
} else {
- ce = EX_T(opline->op1.u.var).class_entry;
+ ce = EX_T(opline->op1.var).class_entry;
}
- if (zend_hash_find(&ce->constants_table, Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant)+1, (void **) &value) == SUCCESS) {
+ if (zend_hash_quick_find(&ce->constants_table, Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv)+1, Z_HASH_P(opline->op2.zv), (void **) &value) == SUCCESS) {
if (Z_TYPE_PP(value) == IS_CONSTANT_ARRAY ||
(Z_TYPE_PP(value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
zend_class_entry *old_scope = EG(scope);
@@ -2800,10 +2815,10 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
zval_update_constant(value, (void *) 1 TSRMLS_CC);
EG(scope) = old_scope;
}
- EX_T(opline->result.u.var).tmp_var = **value;
- zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var);
+ EX_T(opline->result.var).tmp_var = **value;
+ zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
} else {
- zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL(opline->op2.u.constant));
+ zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv));
}
ZEND_VM_NEXT_OPCODE();
@@ -2814,9 +2829,11 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_O
{
zend_op *opline = EX(opline);
- zval *array_ptr = &EX_T(opline->result.u.var).tmp_var;
+ zval *array_ptr = &EX_T(opline->result.var).tmp_var;
zval *expr_ptr;
- zval *offset=&opline->op2.u.constant;
+ zval *offset=opline->op2.zv;
+ ulong hval;
+ long index;
#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV
zval **expr_ptr_ptr = NULL;
@@ -2825,10 +2842,10 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_O
expr_ptr_ptr=NULL;
expr_ptr = *expr_ptr_ptr;
} else {
- expr_ptr=&opline->op1.u.constant;
+ expr_ptr=opline->op1.zv;
}
#else
- expr_ptr=&opline->op1.u.constant;
+ expr_ptr=opline->op1.zv;
#endif
if (0) { /* temporary variable */
@@ -2859,14 +2876,22 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_O
if (offset) {
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL);
- break;
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ goto num_index;
case IS_LONG:
case IS_BOOL:
- zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
+ index = Z_LVAL_P(offset);
+num_index:
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), index, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
+ if (IS_CONST == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index);
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
+ }
+ zend_hash_quick_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
@@ -2893,7 +2918,7 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_H
{
zend_op *opline = EX(opline);
- array_init(&EX_T(opline->result.u.var).tmp_var);
+ array_init(&EX_T(opline->result.var).tmp_var);
if (IS_CONST == IS_UNUSED) {
ZEND_VM_NEXT_OPCODE();
#if 0 || IS_CONST != IS_UNUSED
@@ -2907,8 +2932,8 @@ static int ZEND_FASTCALL ZEND_DECLARE_CONST_SPEC_CONST_CONST_HANDLER(ZEND_OPCOD
{
zend_op *opline = EX(opline);
- zval *name = &opline->op1.u.constant;
- zval *val = &opline->op2.u.constant;
+ zval *name = opline->op1.zv;
+ zval *val = opline->op2.zv;
zend_constant c;
if ((Z_TYPE_P(val) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT || Z_TYPE_P(val) == IS_CONSTANT_ARRAY) {
@@ -2937,29 +2962,14 @@ static int ZEND_FASTCALL ZEND_DECLARE_CONST_SPEC_CONST_CONST_HANDLER(ZEND_OPCOD
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
-{
- zend_op *opline = EX(opline);
- zend_function *op_array;
-
- if (zend_hash_quick_find(EG(function_table), Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), Z_LVAL(opline->op2.u.constant), (void *) &op_array) == FAILURE ||
- op_array->type != ZEND_USER_FUNCTION) {
- zend_error_noreturn(E_ERROR, "Base lambda function for closure not found");
- }
-
- zend_create_closure(&EX_T(opline->result.u.var).tmp_var, op_array, EG(scope), EG(This) TSRMLS_CC);
-
- ZEND_VM_NEXT_OPCODE();
-}
-
static int ZEND_FASTCALL ZEND_ADD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
zend_free_op free_op2;
- add_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ add_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -2970,9 +2980,9 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zend_free_op free_op2;
- sub_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ sub_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -2983,9 +2993,9 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zend_free_op free_op2;
- mul_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ mul_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -2996,9 +3006,9 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zend_free_op free_op2;
- div_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ div_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -3009,9 +3019,9 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zend_free_op free_op2;
- mod_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ mod_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -3022,9 +3032,9 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_op *opline = EX(opline);
zend_free_op free_op2;
- shift_left_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ shift_left_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -3035,9 +3045,9 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_op *opline = EX(opline);
zend_free_op free_op2;
- shift_right_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ shift_right_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -3048,9 +3058,9 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER
zend_op *opline = EX(opline);
zend_free_op free_op2;
- concat_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ concat_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -3061,9 +3071,9 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_H
zend_op *opline = EX(opline);
zend_free_op free_op2;
- is_identical_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ is_identical_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -3073,11 +3083,11 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCO
{
zend_op *opline = EX(opline);
zend_free_op free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
is_identical_function(result,
- &opline->op1.u.constant,
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ opline->op1.zv,
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
Z_LVAL_P(result) = !Z_LVAL_P(result);
zval_dtor(free_op2.var);
@@ -3088,11 +3098,11 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDL
{
zend_op *opline = EX(opline);
zend_free_op free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- &opline->op1.u.constant,
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ opline->op1.zv,
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) == 0));
zval_dtor(free_op2.var);
@@ -3103,11 +3113,11 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_H
{
zend_op *opline = EX(opline);
zend_free_op free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- &opline->op1.u.constant,
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ opline->op1.zv,
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) != 0));
zval_dtor(free_op2.var);
@@ -3118,11 +3128,11 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HAN
{
zend_op *opline = EX(opline);
zend_free_op free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- &opline->op1.u.constant,
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ opline->op1.zv,
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) < 0));
zval_dtor(free_op2.var);
@@ -3133,11 +3143,11 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMP_HANDLER(ZEND_O
{
zend_op *opline = EX(opline);
zend_free_op free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- &opline->op1.u.constant,
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ opline->op1.zv,
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) <= 0));
zval_dtor(free_op2.var);
@@ -3149,9 +3159,9 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_
zend_op *opline = EX(opline);
zend_free_op free_op2;
- bitwise_or_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ bitwise_or_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -3162,9 +3172,9 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER
zend_op *opline = EX(opline);
zend_free_op free_op2;
- bitwise_and_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ bitwise_and_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -3175,9 +3185,9 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER
zend_op *opline = EX(opline);
zend_free_op free_op2;
- bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -3188,9 +3198,9 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDL
zend_op *opline = EX(opline);
zend_free_op free_op2;
- boolean_xor_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ boolean_xor_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -3206,15 +3216,15 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE
if (IS_CONST == IS_CONST) {
/* no function found. try a static method in class */
- ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
if (!ce) {
- zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL(opline->op1.u.constant));
+ zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
}
EX(called_scope) = ce;
} else {
- ce = EX_T(opline->op1.u.var).class_entry;
+ ce = EX_T(opline->op1.var).class_entry;
- if (opline->op1.u.EA.type == ZEND_FETCH_CLASS_PARENT || opline->op1.u.EA.type == ZEND_FETCH_CLASS_SELF) {
+ if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) {
EX(called_scope) = EG(called_scope);
} else {
EX(called_scope) = ce;
@@ -3226,10 +3236,10 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE
zend_free_op free_op2;
if (IS_TMP_VAR == IS_CONST) {
- function_name_strval = Z_STRVAL(opline->op2.u.constant);
- function_name_strlen = Z_STRLEN(opline->op2.u.constant);
+ function_name_strval = Z_STRVAL_P(opline->op2.zv);
+ function_name_strlen = Z_STRLEN_P(opline->op2.zv);
} else {
- function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
+ function_name = _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC);
if (Z_TYPE_P(function_name) != IS_STRING) {
zend_error_noreturn(E_ERROR, "Function name must be a string");
@@ -3243,7 +3253,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE
if (ce->get_static_method) {
EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
} else {
- EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+ EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_TMP_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
}
if (!EX(fbc)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval);
@@ -3300,16 +3310,16 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
zend_free_op free_op2;
if (IS_CONST==IS_VAR) {
- if (EX_T(opline->op1.u.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr);
+ if (EX_T(opline->op1.var).var.ptr_ptr) {
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
} else {
switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.u.var).str_offset.str);
+ Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
}
}
- is_equal_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ is_equal_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op2.var);
if (switch_expr_is_overloaded) {
@@ -3319,8 +3329,8 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
* are allocated at each get_zval_ptr())
*/
- EX_T(opline->op1.u.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.u.var).var.ptr = NULL;
+ EX_T(opline->op1.var).var.ptr_ptr = NULL;
+ EX_T(opline->op1.var).var.ptr = NULL;
}
ZEND_VM_NEXT_OPCODE();
}
@@ -3329,9 +3339,11 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPC
{
zend_op *opline = EX(opline);
zend_free_op free_op2;
- zval *array_ptr = &EX_T(opline->result.u.var).tmp_var;
+ zval *array_ptr = &EX_T(opline->result.var).tmp_var;
zval *expr_ptr;
- zval *offset=_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
+ zval *offset=_get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC);
+ ulong hval;
+ long index;
#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV
zval **expr_ptr_ptr = NULL;
@@ -3340,10 +3352,10 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPC
expr_ptr_ptr=NULL;
expr_ptr = *expr_ptr_ptr;
} else {
- expr_ptr=&opline->op1.u.constant;
+ expr_ptr=opline->op1.zv;
}
#else
- expr_ptr=&opline->op1.u.constant;
+ expr_ptr=opline->op1.zv;
#endif
if (0) { /* temporary variable */
@@ -3374,14 +3386,22 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPC
if (offset) {
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL);
- break;
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ goto num_index;
case IS_LONG:
case IS_BOOL:
- zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
+ index = Z_LVAL_P(offset);
+num_index:
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), index, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
+ if (IS_TMP_VAR == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index);
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
+ }
+ zend_hash_quick_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
@@ -3408,7 +3428,7 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HAN
{
zend_op *opline = EX(opline);
- array_init(&EX_T(opline->result.u.var).tmp_var);
+ array_init(&EX_T(opline->result.var).tmp_var);
if (IS_CONST == IS_UNUSED) {
ZEND_VM_NEXT_OPCODE();
#if 0 || IS_CONST != IS_UNUSED
@@ -3423,9 +3443,9 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zend_free_op free_op2;
- add_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ add_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -3436,9 +3456,9 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zend_free_op free_op2;
- sub_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ sub_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -3449,9 +3469,9 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zend_free_op free_op2;
- mul_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ mul_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -3462,9 +3482,9 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zend_free_op free_op2;
- div_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ div_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -3475,9 +3495,9 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zend_free_op free_op2;
- mod_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ mod_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -3488,9 +3508,9 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_op *opline = EX(opline);
zend_free_op free_op2;
- shift_left_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ shift_left_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -3501,9 +3521,9 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_op *opline = EX(opline);
zend_free_op free_op2;
- shift_right_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ shift_right_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -3514,9 +3534,9 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER
zend_op *opline = EX(opline);
zend_free_op free_op2;
- concat_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ concat_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -3527,9 +3547,9 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_H
zend_op *opline = EX(opline);
zend_free_op free_op2;
- is_identical_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ is_identical_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -3539,11 +3559,11 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCO
{
zend_op *opline = EX(opline);
zend_free_op free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
is_identical_function(result,
- &opline->op1.u.constant,
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ opline->op1.zv,
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
Z_LVAL_P(result) = !Z_LVAL_P(result);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
@@ -3554,11 +3574,11 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDL
{
zend_op *opline = EX(opline);
zend_free_op free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- &opline->op1.u.constant,
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ opline->op1.zv,
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) == 0));
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
@@ -3569,11 +3589,11 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_H
{
zend_op *opline = EX(opline);
zend_free_op free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- &opline->op1.u.constant,
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ opline->op1.zv,
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) != 0));
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
@@ -3584,11 +3604,11 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HAN
{
zend_op *opline = EX(opline);
zend_free_op free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- &opline->op1.u.constant,
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ opline->op1.zv,
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) < 0));
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
@@ -3599,11 +3619,11 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_O
{
zend_op *opline = EX(opline);
zend_free_op free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- &opline->op1.u.constant,
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ opline->op1.zv,
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) <= 0));
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
@@ -3615,9 +3635,9 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_
zend_op *opline = EX(opline);
zend_free_op free_op2;
- bitwise_or_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ bitwise_or_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -3628,9 +3648,9 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER
zend_op *opline = EX(opline);
zend_free_op free_op2;
- bitwise_and_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ bitwise_and_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -3641,9 +3661,9 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER
zend_op *opline = EX(opline);
zend_free_op free_op2;
- bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -3654,9 +3674,9 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDL
zend_op *opline = EX(opline);
zend_free_op free_op2;
- boolean_xor_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ boolean_xor_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -3672,15 +3692,15 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE
if (IS_CONST == IS_CONST) {
/* no function found. try a static method in class */
- ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
if (!ce) {
- zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL(opline->op1.u.constant));
+ zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
}
EX(called_scope) = ce;
} else {
- ce = EX_T(opline->op1.u.var).class_entry;
+ ce = EX_T(opline->op1.var).class_entry;
- if (opline->op1.u.EA.type == ZEND_FETCH_CLASS_PARENT || opline->op1.u.EA.type == ZEND_FETCH_CLASS_SELF) {
+ if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) {
EX(called_scope) = EG(called_scope);
} else {
EX(called_scope) = ce;
@@ -3692,10 +3712,10 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE
zend_free_op free_op2;
if (IS_VAR == IS_CONST) {
- function_name_strval = Z_STRVAL(opline->op2.u.constant);
- function_name_strlen = Z_STRLEN(opline->op2.u.constant);
+ function_name_strval = Z_STRVAL_P(opline->op2.zv);
+ function_name_strlen = Z_STRLEN_P(opline->op2.zv);
} else {
- function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
+ function_name = _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC);
if (Z_TYPE_P(function_name) != IS_STRING) {
zend_error_noreturn(E_ERROR, "Function name must be a string");
@@ -3709,7 +3729,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE
if (ce->get_static_method) {
EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
} else {
- EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+ EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
}
if (!EX(fbc)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval);
@@ -3766,16 +3786,16 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
zend_free_op free_op2;
if (IS_CONST==IS_VAR) {
- if (EX_T(opline->op1.u.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr);
+ if (EX_T(opline->op1.var).var.ptr_ptr) {
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
} else {
switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.u.var).str_offset.str);
+ Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
}
}
- is_equal_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ is_equal_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
if (switch_expr_is_overloaded) {
@@ -3785,8 +3805,8 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
* are allocated at each get_zval_ptr())
*/
- EX_T(opline->op1.u.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.u.var).var.ptr = NULL;
+ EX_T(opline->op1.var).var.ptr_ptr = NULL;
+ EX_T(opline->op1.var).var.ptr = NULL;
}
ZEND_VM_NEXT_OPCODE();
}
@@ -3795,9 +3815,11 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPC
{
zend_op *opline = EX(opline);
zend_free_op free_op2;
- zval *array_ptr = &EX_T(opline->result.u.var).tmp_var;
+ zval *array_ptr = &EX_T(opline->result.var).tmp_var;
zval *expr_ptr;
- zval *offset=_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
+ zval *offset=_get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC);
+ ulong hval;
+ long index;
#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV
zval **expr_ptr_ptr = NULL;
@@ -3806,10 +3828,10 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPC
expr_ptr_ptr=NULL;
expr_ptr = *expr_ptr_ptr;
} else {
- expr_ptr=&opline->op1.u.constant;
+ expr_ptr=opline->op1.zv;
}
#else
- expr_ptr=&opline->op1.u.constant;
+ expr_ptr=opline->op1.zv;
#endif
if (0) { /* temporary variable */
@@ -3840,14 +3862,22 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPC
if (offset) {
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL);
- break;
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ goto num_index;
case IS_LONG:
case IS_BOOL:
- zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
+ index = Z_LVAL_P(offset);
+num_index:
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), index, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
+ if (IS_VAR == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index);
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
+ }
+ zend_hash_quick_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
@@ -3874,7 +3904,7 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HAN
{
zend_op *opline = EX(opline);
- array_init(&EX_T(opline->result.u.var).tmp_var);
+ array_init(&EX_T(opline->result.var).tmp_var);
if (IS_CONST == IS_UNUSED) {
ZEND_VM_NEXT_OPCODE();
#if 0 || IS_CONST != IS_UNUSED
@@ -3894,15 +3924,15 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER
if (IS_CONST == IS_CONST) {
/* no function found. try a static method in class */
- ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
if (!ce) {
- zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL(opline->op1.u.constant));
+ zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
}
EX(called_scope) = ce;
} else {
- ce = EX_T(opline->op1.u.var).class_entry;
+ ce = EX_T(opline->op1.var).class_entry;
- if (opline->op1.u.EA.type == ZEND_FETCH_CLASS_PARENT || opline->op1.u.EA.type == ZEND_FETCH_CLASS_SELF) {
+ if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) {
EX(called_scope) = EG(called_scope);
} else {
EX(called_scope) = ce;
@@ -3914,8 +3944,8 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER
if (IS_UNUSED == IS_CONST) {
- function_name_strval = Z_STRVAL(opline->op2.u.constant);
- function_name_strlen = Z_STRLEN(opline->op2.u.constant);
+ function_name_strval = Z_STRVAL_P(opline->op2.zv);
+ function_name_strlen = Z_STRLEN_P(opline->op2.zv);
} else {
function_name = NULL;
@@ -3931,7 +3961,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER
if (ce->get_static_method) {
EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
} else {
- EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+ EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_UNUSED == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
}
if (!EX(fbc)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval);
@@ -3985,9 +4015,11 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_
{
zend_op *opline = EX(opline);
- zval *array_ptr = &EX_T(opline->result.u.var).tmp_var;
+ zval *array_ptr = &EX_T(opline->result.var).tmp_var;
zval *expr_ptr;
zval *offset=NULL;
+ ulong hval;
+ long index;
#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV
zval **expr_ptr_ptr = NULL;
@@ -3996,10 +4028,10 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_
expr_ptr_ptr=NULL;
expr_ptr = *expr_ptr_ptr;
} else {
- expr_ptr=&opline->op1.u.constant;
+ expr_ptr=opline->op1.zv;
}
#else
- expr_ptr=&opline->op1.u.constant;
+ expr_ptr=opline->op1.zv;
#endif
if (0) { /* temporary variable */
@@ -4030,14 +4062,22 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_
if (offset) {
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL);
- break;
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ goto num_index;
case IS_LONG:
case IS_BOOL:
- zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
+ index = Z_LVAL_P(offset);
+num_index:
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), index, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
+ if (IS_UNUSED == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index);
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
+ }
+ zend_hash_quick_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
@@ -4064,7 +4104,7 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_
{
zend_op *opline = EX(opline);
- array_init(&EX_T(opline->result.u.var).tmp_var);
+ array_init(&EX_T(opline->result.var).tmp_var);
if (IS_CONST == IS_UNUSED) {
ZEND_VM_NEXT_OPCODE();
#if 0 || IS_CONST != IS_UNUSED
@@ -4074,14 +4114,29 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_
}
}
+static int ZEND_FASTCALL ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ zend_op *opline = EX(opline);
+ zend_function *op_array;
+
+ if (zend_hash_quick_find(EG(function_table), Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), Z_HASH_P(opline->op1.zv), (void *) &op_array) == FAILURE ||
+ op_array->type != ZEND_USER_FUNCTION) {
+ zend_error_noreturn(E_ERROR, "Base lambda function for closure not found");
+ }
+
+ zend_create_closure(&EX_T(opline->result.var).tmp_var, op_array, EG(scope), EG(This) TSRMLS_CC);
+
+ ZEND_VM_NEXT_OPCODE();
+}
+
static int ZEND_FASTCALL ZEND_ADD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- add_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ add_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -4092,9 +4147,9 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_op *opline = EX(opline);
- sub_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ sub_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -4105,9 +4160,9 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_op *opline = EX(opline);
- mul_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ mul_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -4118,9 +4173,9 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_op *opline = EX(opline);
- div_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ div_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -4131,9 +4186,9 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_op *opline = EX(opline);
- mod_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ mod_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -4144,9 +4199,9 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zend_op *opline = EX(opline);
- shift_left_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ shift_left_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -4157,9 +4212,9 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zend_op *opline = EX(opline);
- shift_right_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ shift_right_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -4170,9 +4225,9 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_
zend_op *opline = EX(opline);
- concat_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ concat_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -4183,9 +4238,9 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HA
zend_op *opline = EX(opline);
- is_identical_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ is_identical_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -4195,11 +4250,11 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CV_HANDLER(ZEND_OPCOD
{
zend_op *opline = EX(opline);
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
is_identical_function(result,
- &opline->op1.u.constant,
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ opline->op1.zv,
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
Z_LVAL_P(result) = !Z_LVAL_P(result);
@@ -4210,11 +4265,11 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLE
{
zend_op *opline = EX(opline);
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- &opline->op1.u.constant,
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ opline->op1.zv,
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) == 0));
@@ -4225,11 +4280,11 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HA
{
zend_op *opline = EX(opline);
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- &opline->op1.u.constant,
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ opline->op1.zv,
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) != 0));
@@ -4240,11 +4295,11 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HAND
{
zend_op *opline = EX(opline);
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- &opline->op1.u.constant,
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ opline->op1.zv,
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) < 0));
@@ -4255,11 +4310,11 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OP
{
zend_op *opline = EX(opline);
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- &opline->op1.u.constant,
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ opline->op1.zv,
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) <= 0));
@@ -4271,9 +4326,9 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A
zend_op *opline = EX(opline);
- bitwise_or_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ bitwise_or_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -4284,9 +4339,9 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_
zend_op *opline = EX(opline);
- bitwise_and_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ bitwise_and_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -4297,9 +4352,9 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_
zend_op *opline = EX(opline);
- bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -4310,9 +4365,9 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLE
zend_op *opline = EX(opline);
- boolean_xor_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ boolean_xor_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
@@ -4328,15 +4383,15 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN
if (IS_CONST == IS_CONST) {
/* no function found. try a static method in class */
- ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
if (!ce) {
- zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL(opline->op1.u.constant));
+ zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
}
EX(called_scope) = ce;
} else {
- ce = EX_T(opline->op1.u.var).class_entry;
+ ce = EX_T(opline->op1.var).class_entry;
- if (opline->op1.u.EA.type == ZEND_FETCH_CLASS_PARENT || opline->op1.u.EA.type == ZEND_FETCH_CLASS_SELF) {
+ if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) {
EX(called_scope) = EG(called_scope);
} else {
EX(called_scope) = ce;
@@ -4348,10 +4403,10 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN
if (IS_CV == IS_CONST) {
- function_name_strval = Z_STRVAL(opline->op2.u.constant);
- function_name_strlen = Z_STRLEN(opline->op2.u.constant);
+ function_name_strval = Z_STRVAL_P(opline->op2.zv);
+ function_name_strlen = Z_STRLEN_P(opline->op2.zv);
} else {
- function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
+ function_name = _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC);
if (Z_TYPE_P(function_name) != IS_STRING) {
zend_error_noreturn(E_ERROR, "Function name must be a string");
@@ -4365,7 +4420,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN
if (ce->get_static_method) {
EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
} else {
- EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+ EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_CV == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
}
if (!EX(fbc)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval);
@@ -4422,16 +4477,16 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
if (IS_CONST==IS_VAR) {
- if (EX_T(opline->op1.u.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr);
+ if (EX_T(opline->op1.var).var.ptr_ptr) {
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
} else {
switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.u.var).str_offset.str);
+ Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
}
}
- is_equal_function(&EX_T(opline->result.u.var).tmp_var,
- &opline->op1.u.constant,
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ is_equal_function(&EX_T(opline->result.var).tmp_var,
+ opline->op1.zv,
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
if (switch_expr_is_overloaded) {
/* We only free op1 if this is a string offset,
@@ -4440,8 +4495,8 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
* are allocated at each get_zval_ptr())
*/
- EX_T(opline->op1.u.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.u.var).var.ptr = NULL;
+ EX_T(opline->op1.var).var.ptr_ptr = NULL;
+ EX_T(opline->op1.var).var.ptr = NULL;
}
ZEND_VM_NEXT_OPCODE();
}
@@ -4450,9 +4505,11 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCO
{
zend_op *opline = EX(opline);
- zval *array_ptr = &EX_T(opline->result.u.var).tmp_var;
+ zval *array_ptr = &EX_T(opline->result.var).tmp_var;
zval *expr_ptr;
- zval *offset=_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
+ zval *offset=_get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC);
+ ulong hval;
+ long index;
#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV
zval **expr_ptr_ptr = NULL;
@@ -4461,10 +4518,10 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCO
expr_ptr_ptr=NULL;
expr_ptr = *expr_ptr_ptr;
} else {
- expr_ptr=&opline->op1.u.constant;
+ expr_ptr=opline->op1.zv;
}
#else
- expr_ptr=&opline->op1.u.constant;
+ expr_ptr=opline->op1.zv;
#endif
if (0) { /* temporary variable */
@@ -4495,14 +4552,22 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCO
if (offset) {
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL);
- break;
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ goto num_index;
case IS_LONG:
case IS_BOOL:
- zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
+ index = Z_LVAL_P(offset);
+num_index:
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), index, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
+ if (IS_CV == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index);
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
+ }
+ zend_hash_quick_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
@@ -4529,7 +4594,7 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HAND
{
zend_op *opline = EX(opline);
- array_init(&EX_T(opline->result.u.var).tmp_var);
+ array_init(&EX_T(opline->result.var).tmp_var);
if (IS_CONST == IS_UNUSED) {
ZEND_VM_NEXT_OPCODE();
#if 0 || IS_CONST != IS_UNUSED
@@ -4544,8 +4609,8 @@ static int ZEND_FASTCALL ZEND_BW_NOT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_op *opline = EX(opline);
zend_free_op free_op1;
- bitwise_not_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC) TSRMLS_CC);
+ bitwise_not_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
}
@@ -4555,8 +4620,8 @@ static int ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_op *opline = EX(opline);
zend_free_op free_op1;
- boolean_not_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC) TSRMLS_CC);
+ boolean_not_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
}
@@ -4566,7 +4631,7 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_op *opline = EX(opline);
zend_free_op free_op1;
zval z_copy;
- zval *z = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *z = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (IS_TMP_VAR != IS_CONST &&
Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL &&
@@ -4585,8 +4650,8 @@ static int ZEND_FASTCALL ZEND_PRINT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1;
- Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG;
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = 1;
+ Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_LONG;
return ZEND_ECHO_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
@@ -4595,10 +4660,11 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP(int type, ZEND_O
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *varname = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *varname = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
zval **retval;
zval tmp_varname;
HashTable *target_symbol_table;
+ ulong hash_value;
if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
tmp_varname = *varname;
@@ -4607,17 +4673,23 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP(int type, ZEND_O
varname = &tmp_varname;
}
- if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
- retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC);
+ if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC_MEMBER) {
+ retval = zend_std_get_static_property(EX_T(opline->op2.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((IS_TMP_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
zval_dtor(free_op1.var);
} else {
- target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
/*
if (!target_symbol_table) {
ZEND_VM_NEXT_OPCODE();
}
*/
- if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &retval) == FAILURE) {
+ if (IS_TMP_VAR == IS_CONST) {
+ hash_value = Z_HASH_P(varname);
+ } else {
+ hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
+ }
+
+ if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
switch (type) {
case BP_VAR_R:
case BP_VAR_UNSET:
@@ -4633,13 +4705,13 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP(int type, ZEND_O
zval *new_zval = &EG(uninitialized_zval);
Z_ADDREF_P(new_zval);
- zend_hash_update(target_symbol_table, varname->value.str.val, varname->value.str.len+1, &new_zval, sizeof(zval *), (void **) &retval);
+ zend_hash_quick_update(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, &new_zval, sizeof(zval *), (void **) &retval);
}
break;
EMPTY_SWITCH_DEFAULT_CASE()
}
}
- switch (opline->op2.u.EA.type) {
+ switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) {
case ZEND_FETCH_GLOBAL:
if (IS_TMP_VAR != IS_TMP_VAR) {
zval_dtor(free_op1.var);
@@ -4653,7 +4725,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP(int type, ZEND_O
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_TMP_VAR == IS_VAR && !free_op1.var) {
- PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr);
+ PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
}
break;
}
@@ -4663,7 +4735,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP(int type, ZEND_O
if (IS_TMP_VAR != IS_CONST && varname == &tmp_varname) {
zval_dtor(varname);
}
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
+ if (RETURN_VALUE_USED(opline)) {
if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
SEPARATE_ZVAL_TO_MAKE_IS_REF(retval);
}
@@ -4671,21 +4743,21 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP(int type, ZEND_O
switch (type) {
case BP_VAR_R:
case BP_VAR_IS:
- AI_SET_PTR(EX_T(opline->result.u.var).var, *retval);
+ AI_SET_PTR(EX_T(opline->result.var).var, *retval);
break;
case BP_VAR_UNSET: {
zend_free_op free_res;
- EX_T(opline->result.u.var).var.ptr_ptr = retval;
- PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res);
- if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
- SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr);
+ EX_T(opline->result.var).var.ptr_ptr = retval;
+ PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res);
+ if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
+ SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.var).var.ptr_ptr);
}
- PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr);
+ PZVAL_LOCK(*EX_T(opline->result.var).var.ptr_ptr);
FREE_OP_VAR_PTR(free_res);
break;
default:
- EX_T(opline->result.u.var).var.ptr_ptr = retval;
+ EX_T(opline->result.var).var.ptr_ptr = retval;
break;
}
}
@@ -4710,7 +4782,7 @@ static int ZEND_FASTCALL ZEND_FETCH_RW_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- return zend_fetch_var_address_helper_SPEC_TMP(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), EX(opline)->extended_value)?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ return zend_fetch_var_address_helper_SPEC_TMP(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (EX(opline)->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -4727,7 +4799,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *val = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *val = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
int ret;
if (IS_TMP_VAR == IS_TMP_VAR && Z_TYPE_P(val) == IS_BOOL) {
@@ -4741,9 +4813,9 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
if (!ret) {
#if DEBUG_ZEND>=2
- printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
+ printf("Conditional jmp to %d\n", opline->op2.opline_num);
#endif
- ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr);
+ ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
ZEND_VM_CONTINUE();
}
@@ -4754,7 +4826,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *val = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *val = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
int ret;
if (IS_TMP_VAR == IS_TMP_VAR && Z_TYPE_P(val) == IS_BOOL) {
@@ -4768,9 +4840,9 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
if (ret) {
#if DEBUG_ZEND>=2
- printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
+ printf("Conditional jmp to %d\n", opline->op2.opline_num);
#endif
- ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr);
+ ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
ZEND_VM_CONTINUE();
}
@@ -4781,7 +4853,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *val = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *val = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
int retval;
if (IS_TMP_VAR == IS_TMP_VAR && Z_TYPE_P(val) == IS_BOOL) {
@@ -4801,9 +4873,9 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ZEND_VM_CONTINUE(); /* CHECK_ME */
} else {
#if DEBUG_ZEND>=2
- printf("Conditional jmp on false to %d\n", opline->op2.u.opline_num);
+ printf("Conditional jmp on false to %d\n", opline->op2.opline_num);
#endif
- ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.u.opline_num]);
+ ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]);
ZEND_VM_CONTINUE(); /* CHECK_ME */
}
}
@@ -4812,7 +4884,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *val = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *val = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
int retval;
if (IS_TMP_VAR == IS_TMP_VAR && Z_TYPE_P(val) == IS_BOOL) {
@@ -4824,13 +4896,13 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
ZEND_VM_CONTINUE();
}
}
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval;
- Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = retval;
+ Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
if (!retval) {
#if DEBUG_ZEND>=2
- printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
+ printf("Conditional jmp to %d\n", opline->op2.opline_num);
#endif
- ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr);
+ ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
ZEND_VM_CONTINUE();
}
ZEND_VM_NEXT_OPCODE();
@@ -4840,7 +4912,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *val = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *val = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
int retval;
if (IS_TMP_VAR == IS_TMP_VAR && Z_TYPE_P(val) == IS_BOOL) {
@@ -4852,13 +4924,13 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZEND_VM_CONTINUE();
}
}
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval;
- Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = retval;
+ Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
if (retval) {
#if DEBUG_ZEND>=2
- printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
+ printf("Conditional jmp to %d\n", opline->op2.opline_num);
#endif
- ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr);
+ ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
ZEND_VM_CONTINUE();
}
ZEND_VM_NEXT_OPCODE();
@@ -4866,7 +4938,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
static int ZEND_FASTCALL ZEND_FREE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- zendi_zval_dtor(EX_T(EX(opline)->op1.u.var).tmp_var);
+ zendi_zval_dtor(EX_T(EX(opline)->op1.var).tmp_var);
ZEND_VM_NEXT_OPCODE();
}
@@ -4893,8 +4965,8 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (IS_TMP_VAR == IS_VAR && !Z_ISREF_PP(retval_ptr_ptr)) {
if (opline->extended_value == ZEND_RETURNS_FUNCTION &&
- EX_T(opline->op1.u.var).var.fcall_returned_reference) {
- } else if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) {
+ EX_T(opline->op1.var).var.fcall_returned_reference) {
+ } else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) {
if (IS_TMP_VAR == IS_VAR && !1) {
PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
}
@@ -4912,7 +4984,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
return_by_value:
- retval_ptr = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ retval_ptr = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (!EG(return_value_ptr_ptr)) {
if (IS_TMP_VAR == IS_TMP_VAR) {
@@ -4951,7 +5023,7 @@ static int ZEND_FASTCALL ZEND_THROW_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *exception;
zend_free_op free_op1;
- value = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (IS_TMP_VAR == IS_CONST || Z_TYPE_P(value) != IS_OBJECT) {
zend_error_noreturn(E_ERROR, "Can only throw objects");
@@ -4974,15 +5046,15 @@ static int ZEND_FASTCALL ZEND_SEND_VAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
{
zend_op *opline = EX(opline);
if (opline->extended_value==ZEND_DO_FCALL_BY_NAME
- && ARG_MUST_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
- zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.u.opline_num);
+ && ARG_MUST_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
+ zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.opline_num);
}
{
zval *valptr;
zval *value;
zend_free_op free_op1;
- value = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
ALLOC_ZVAL(valptr);
INIT_PZVAL_COPY(valptr, value);
@@ -5001,8 +5073,8 @@ static int ZEND_FASTCALL ZEND_BOOL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_free_op free_op1;
/* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = i_zend_is_true(_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC));
- Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = i_zend_is_true(_get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC));
+ Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -5012,7 +5084,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *obj = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *obj = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
zend_class_entry *ce;
zend_function *clone;
zend_object_clone_obj_t clone_call;
@@ -5050,15 +5122,15 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
- EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
+ EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
if (!EG(exception)) {
- ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
- Z_OBJVAL_P(EX_T(opline->result.u.var).var.ptr) = clone_call(obj TSRMLS_CC);
- Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_OBJECT;
- Z_SET_REFCOUNT_P(EX_T(opline->result.u.var).var.ptr, 1);
- Z_SET_ISREF_P(EX_T(opline->result.u.var).var.ptr);
+ ALLOC_ZVAL(EX_T(opline->result.var).var.ptr);
+ Z_OBJVAL_P(EX_T(opline->result.var).var.ptr) = clone_call(obj TSRMLS_CC);
+ Z_TYPE_P(EX_T(opline->result.var).var.ptr) = IS_OBJECT;
+ Z_SET_REFCOUNT_P(EX_T(opline->result.var).var.ptr, 1);
+ Z_SET_ISREF_P(EX_T(opline->result.var).var.ptr);
if (!RETURN_VALUE_USED(opline) || EG(exception)) {
- zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
+ zval_ptr_dtor(&EX_T(opline->result.var).var.ptr);
}
}
@@ -5069,8 +5141,8 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *expr = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *expr = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *result = &EX_T(opline->result.var).tmp_var;
if (opline->extended_value != IS_STRING) {
*result = *expr;
@@ -5126,7 +5198,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
zend_op_array *new_op_array=NULL;
int return_value_used;
zend_free_op free_op1;
- zval *inc_filename = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *inc_filename = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
zval tmp_inc_filename;
zend_bool failure_retval=0;
@@ -5139,7 +5211,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
return_value_used = RETURN_VALUE_USED(opline);
- switch (Z_LVAL(opline->op2.u.constant)) {
+ switch (opline->extended_value) {
case ZEND_INCLUDE_ONCE:
case ZEND_REQUIRE_ONCE: {
zend_file_handle file_handle;
@@ -5161,14 +5233,14 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
}
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
- new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
+ new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
zend_destroy_file_handle(&file_handle TSRMLS_CC);
} else {
zend_file_handle_dtor(&file_handle TSRMLS_CC);
failure_retval=1;
}
} else {
- if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) {
+ if (opline->extended_value == ZEND_INCLUDE_ONCE) {
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
} else {
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
@@ -5181,7 +5253,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
break;
case ZEND_INCLUDE:
case ZEND_REQUIRE:
- new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC);
+ new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
break;
case ZEND_EVAL: {
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
@@ -5196,12 +5268,12 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
zval_dtor(&tmp_inc_filename);
}
zval_dtor(free_op1.var);
- EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
+ EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
if (new_op_array && !EG(exception)) {
EX(original_return_value) = EG(return_value_ptr_ptr);
- EG(return_value_ptr_ptr) = return_value_used ? EX_T(opline->result.u.var).var.ptr_ptr : NULL;
+ EG(return_value_ptr_ptr) = return_value_used ? EX_T(opline->result.var).var.ptr_ptr : NULL;
EG(active_op_array) = new_op_array;
- EX_T(opline->result.u.var).var.ptr = NULL;
+ EX_T(opline->result.var).var.ptr = NULL;
EX(current_object) = EX(object);
@@ -5223,11 +5295,11 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
EX(object) = EX(current_object);
if (return_value_used) {
- if (!EX_T(opline->result.u.var).var.ptr) { /* there was no return statement */
- ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
- INIT_PZVAL(EX_T(opline->result.u.var).var.ptr);
- Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = 1;
- Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL;
+ if (!EX_T(opline->result.var).var.ptr) { /* there was no return statement */
+ ALLOC_ZVAL(EX_T(opline->result.var).var.ptr);
+ INIT_PZVAL(EX_T(opline->result.var).var.ptr);
+ Z_LVAL_P(EX_T(opline->result.var).var.ptr) = 1;
+ Z_TYPE_P(EX_T(opline->result.var).var.ptr) = IS_BOOL;
}
}
@@ -5241,10 +5313,10 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
}
} else {
if (return_value_used) {
- ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
- INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr);
- Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = failure_retval;
- Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL;
+ ALLOC_ZVAL(EX_T(opline->result.var).var.ptr);
+ INIT_ZVAL(*EX_T(opline->result.var).var.ptr);
+ Z_LVAL_P(EX_T(opline->result.var).var.ptr) = failure_retval;
+ Z_TYPE_P(EX_T(opline->result.var).var.ptr) = IS_BOOL;
}
}
ZEND_VM_NEXT_OPCODE();
@@ -5260,7 +5332,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
if (IS_TMP_VAR == IS_CV && (opline->extended_value & ZEND_QUICK_SET)) {
if (EG(active_symbol_table)) {
zend_execute_data *ex = EX(prev_execute_data);
- zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.u.var);
+ zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
if (zend_hash_quick_del(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value) == SUCCESS) {
while (ex && ex->symbol_table == EG(active_symbol_table)) {
@@ -5279,17 +5351,17 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
ex = ex->prev_execute_data;
}
}
- EX(CVs)[opline->op1.u.var] = NULL;
- } else if (EX(CVs)[opline->op1.u.var]) {
- zval_ptr_dtor(EX(CVs)[opline->op1.u.var]);
- EX(CVs)[opline->op1.u.var] = NULL;
+ EX(CVs)[opline->op1.var] = NULL;
+ } else if (EX(CVs)[opline->op1.var]) {
+ zval_ptr_dtor(EX(CVs)[opline->op1.var]);
+ EX(CVs)[opline->op1.var] = NULL;
}
ZEND_VM_NEXT_OPCODE();
}
- varname = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ varname = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
- if (Z_TYPE_P(varname) != IS_STRING) {
+ if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
tmp = *varname;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
@@ -5298,12 +5370,12 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
Z_ADDREF_P(varname);
}
- if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
- zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname) TSRMLS_CC);
+ if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC_MEMBER) {
+ zend_std_unset_static_property(EX_T(opline->op2.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_TMP_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
} else {
ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
- target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
if (zend_hash_quick_del(target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value) == SUCCESS) {
zend_execute_data *ex = execute_data;
@@ -5351,7 +5423,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
} else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) {
if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) {
zend_error(E_WARNING, "foreach() cannot iterate over objects without PHP class");
- ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
+ ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
}
ce = Z_OBJCE_PP(array_ptr_ptr);
@@ -5371,7 +5443,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
Z_ADDREF_P(array_ptr);
}
} else {
- array_ptr = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ array_ptr = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (1) { /* IS_TMP_VAR */
zval *tmp;
@@ -5423,7 +5495,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
}
- AI_SET_PTR(EX_T(opline->result.u.var).var, array_ptr);
+ AI_SET_PTR(EX_T(opline->result.var).var, array_ptr);
PZVAL_LOCK(array_ptr);
if (iter) {
@@ -5473,7 +5545,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
}
is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS;
- zend_hash_get_pointer(fe_ht, &EX_T(opline->result.u.var).fe.fe_pos);
+ zend_hash_get_pointer(fe_ht, &EX_T(opline->result.var).fe.fe_pos);
} else {
zend_error(E_WARNING, "Invalid argument supplied for foreach()");
is_empty = 1;
@@ -5485,7 +5557,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
if (is_empty) {
- ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
+ ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
} else {
ZEND_VM_NEXT_OPCODE();
}
@@ -5498,10 +5570,10 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HA
zend_bool isset = 1;
if (IS_TMP_VAR == IS_CV && (opline->extended_value & ZEND_QUICK_SET)) {
- if (EX(CVs)[opline->op1.u.var]) {
- value = EX(CVs)[opline->op1.u.var];
+ if (EX(CVs)[opline->op1.var]) {
+ value = EX(CVs)[opline->op1.var];
} else if (EG(active_symbol_table)) {
- zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.u.var);
+ zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
isset = 0;
@@ -5512,22 +5584,22 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HA
} else {
HashTable *target_symbol_table;
zend_free_op free_op1;
- zval tmp, *varname = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval tmp, *varname = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
- if (Z_TYPE_P(varname) != IS_STRING) {
+ if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
tmp = *varname;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
varname = &tmp;
}
- if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
- value = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1 TSRMLS_CC);
+ if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC_MEMBER) {
+ value = zend_std_get_static_property(EX_T(opline->op2.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1, ((IS_TMP_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
if (!value) {
isset = 0;
}
} else {
- target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) {
isset = 0;
}
@@ -5539,23 +5611,20 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HA
zval_dtor(free_op1.var);
}
- Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
+ Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
- switch (opline->extended_value & ZEND_ISSET_ISEMPTY_MASK) {
- case ZEND_ISSET:
- if (isset && Z_TYPE_PP(value) == IS_NULL) {
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0;
- } else {
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = isset;
- }
- break;
- case ZEND_ISEMPTY:
- if (!isset || !i_zend_is_true(*value)) {
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1;
- } else {
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0;
- }
- break;
+ if (opline->extended_value & ZEND_ISSET) {
+ if (isset && Z_TYPE_PP(value) == IS_NULL) {
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = 0;
+ } else {
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = isset;
+ }
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (!isset || !i_zend_is_true(*value)) {
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = 1;
+ } else {
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = 0;
+ }
}
ZEND_VM_NEXT_OPCODE();
@@ -5567,7 +5636,7 @@ static int ZEND_FASTCALL ZEND_EXIT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_op *opline = EX(opline);
if (IS_TMP_VAR != IS_UNUSED) {
zend_free_op free_op1;
- zval *ptr = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *ptr = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (Z_TYPE_P(ptr) == IS_LONG) {
EG(exit_status) = Z_LVAL_P(ptr);
@@ -5586,14 +5655,14 @@ static int ZEND_FASTCALL ZEND_END_SILENCE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_
zend_op *opline = EX(opline);
zval restored_error_reporting;
- if (!EG(error_reporting) && Z_LVAL(EX_T(opline->op1.u.var).tmp_var) != 0) {
+ if (!EG(error_reporting) && Z_LVAL(EX_T(opline->op1.var).tmp_var) != 0) {
Z_TYPE(restored_error_reporting) = IS_LONG;
- Z_LVAL(restored_error_reporting) = Z_LVAL(EX_T(opline->op1.u.var).tmp_var);
+ Z_LVAL(restored_error_reporting) = Z_LVAL(EX_T(opline->op1.var).tmp_var);
convert_to_string(&restored_error_reporting);
zend_alter_ini_entry_ex("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME, 1 TSRMLS_CC);
zendi_zval_dtor(restored_error_reporting);
}
- if (EX(old_error_reporting) == &EX_T(opline->op1.u.var).tmp_var) {
+ if (EX(old_error_reporting) == &EX_T(opline->op1.var).tmp_var) {
EX(old_error_reporting) = NULL;
}
ZEND_VM_NEXT_OPCODE();
@@ -5603,16 +5672,16 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *value = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *value = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (i_zend_is_true(value)) {
- EX_T(opline->result.u.var).tmp_var = *value;
- zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var);
+ EX_T(opline->result.var).tmp_var = *value;
+ zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var);
zval_dtor(free_op1.var);
#if DEBUG_ZEND>=2
- printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
+ printf("Conditional jmp to %d\n", opline->op2.opline_num);
#endif
- ZEND_VM_JMP(opline->op2.u.jmp_addr);
+ ZEND_VM_JMP(opline->op2.jmp_addr);
}
zval_dtor(free_op1.var);
@@ -5623,11 +5692,11 @@ static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *value = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *value = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
- EX_T(opline->result.u.var).tmp_var = *value;
+ EX_T(opline->result.var).tmp_var = *value;
if (!1) {
- zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var);
+ zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
}
ZEND_VM_NEXT_OPCODE();
@@ -5637,15 +5706,15 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *expr = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *expr = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
zend_bool result;
if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) {
- result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.u.var).class_entry TSRMLS_CC);
+ result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.var).class_entry TSRMLS_CC);
} else {
result = 0;
}
- ZVAL_BOOL(&EX_T(opline->result.u.var).tmp_var, result);
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
}
@@ -5655,9 +5724,9 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zend_free_op free_op1;
- add_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ add_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -5668,9 +5737,9 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zend_free_op free_op1;
- sub_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ sub_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -5681,9 +5750,9 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zend_free_op free_op1;
- mul_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ mul_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -5694,9 +5763,9 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zend_free_op free_op1;
- div_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ div_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -5707,9 +5776,9 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zend_free_op free_op1;
- mod_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ mod_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -5720,9 +5789,9 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_op *opline = EX(opline);
zend_free_op free_op1;
- shift_left_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ shift_left_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -5733,9 +5802,9 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_op *opline = EX(opline);
zend_free_op free_op1;
- shift_right_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ shift_right_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -5746,9 +5815,9 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER
zend_op *opline = EX(opline);
zend_free_op free_op1;
- concat_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ concat_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -5759,9 +5828,9 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_H
zend_op *opline = EX(opline);
zend_free_op free_op1;
- is_identical_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ is_identical_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -5771,11 +5840,11 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCO
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
is_identical_function(result,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
Z_LVAL_P(result) = !Z_LVAL_P(result);
zval_dtor(free_op1.var);
@@ -5786,11 +5855,11 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDL
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) == 0));
zval_dtor(free_op1.var);
@@ -5801,11 +5870,11 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_H
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) != 0));
zval_dtor(free_op1.var);
@@ -5816,11 +5885,11 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAN
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) < 0));
zval_dtor(free_op1.var);
@@ -5831,11 +5900,11 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_CONST_HANDLER(ZEND_O
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) <= 0));
zval_dtor(free_op1.var);
@@ -5847,9 +5916,9 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_
zend_op *opline = EX(opline);
zend_free_op free_op1;
- bitwise_or_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ bitwise_or_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -5860,9 +5929,9 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER
zend_op *opline = EX(opline);
zend_free_op free_op1;
- bitwise_and_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ bitwise_and_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -5873,9 +5942,9 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER
zend_op *opline = EX(opline);
zend_free_op free_op1;
- bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -5886,9 +5955,9 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDL
zend_op *opline = EX(opline);
zend_free_op free_op1;
- boolean_xor_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ boolean_xor_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -5898,19 +5967,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_TMP_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPC
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *container = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *container = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (Z_TYPE_P(container) != IS_ARRAY) {
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, EG(uninitialized_zval_ptr));
+ if (RETURN_VALUE_USED(opline)) {
+ AI_SET_PTR(EX_T(opline->result.var).var, EG(uninitialized_zval_ptr));
PZVAL_LOCK(EG(uninitialized_zval_ptr));
}
} else {
- zval *dim = &opline->op2.u.constant;
+ zval *dim = opline->op2.zv;
- AI_SET_PTR(EX_T(opline->result.u.var).var, *zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, BP_VAR_R TSRMLS_CC));
- SELECTIVE_PZVAL_LOCK(EX_T(opline->result.u.var).var.ptr, &opline->result);
+ AI_SET_PTR(EX_T(opline->result.var).var, *zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, IS_CONST, BP_VAR_R TSRMLS_CC));
+ SELECTIVE_PZVAL_LOCK(EX_T(opline->result.var).var.ptr, opline);
}
ZEND_VM_NEXT_OPCODE();
@@ -5919,7 +5988,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_TMP_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPC
static int ZEND_FASTCALL ZEND_ADD_CHAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zval *str = &EX_T(opline->result.u.var).tmp_var;
+ zval *str = &EX_T(opline->result.var).tmp_var;
if (IS_TMP_VAR == IS_UNUSED) {
/* Initialize for erealloc in add_char_to_string */
@@ -5930,7 +5999,7 @@ static int ZEND_FASTCALL ZEND_ADD_CHAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDL
INIT_PZVAL(str);
}
- add_char_to_string(str, str, &opline->op2.u.constant);
+ add_char_to_string(str, str, opline->op2.zv);
/* FREE_OP is missing intentionally here - we're always working on the same temporary variable */
ZEND_VM_NEXT_OPCODE();
@@ -5939,7 +6008,7 @@ static int ZEND_FASTCALL ZEND_ADD_CHAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDL
static int ZEND_FASTCALL ZEND_ADD_STRING_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zval *str = &EX_T(opline->result.u.var).tmp_var;
+ zval *str = &EX_T(opline->result.var).tmp_var;
if (IS_TMP_VAR == IS_UNUSED) {
/* Initialize for erealloc in add_string_to_string */
@@ -5950,7 +6019,7 @@ static int ZEND_FASTCALL ZEND_ADD_STRING_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAN
INIT_PZVAL(str);
}
- add_string_to_string(str, str, &opline->op2.u.constant);
+ add_string_to_string(str, str, opline->op2.zv);
/* FREE_OP is missing intentionally here - we're always working on the same temporary variable */
ZEND_VM_NEXT_OPCODE();
@@ -5966,7 +6035,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CONST_HANDLER(ZEND_OPCO
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
- function_name = &opline->op2.u.constant;
+ function_name = opline->op2.zv;
if (Z_TYPE_P(function_name)!=IS_STRING) {
zend_error_noreturn(E_ERROR, "Method name must be a string");
@@ -5975,7 +6044,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CONST_HANDLER(ZEND_OPCO
function_name_strval = Z_STRVAL_P(function_name);
function_name_strlen = Z_STRLEN_P(function_name);
- EX(object) = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ EX(object) = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) {
if (Z_OBJ_HT_P(EX(object))->get_method == NULL) {
@@ -5983,7 +6052,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CONST_HANDLER(ZEND_OPCO
}
/* First, locate the function. */
- EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC);
+ EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_CONST == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
if (!EX(fbc)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval);
}
@@ -6018,16 +6087,16 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
zend_free_op free_op1;
if (IS_TMP_VAR==IS_VAR) {
- if (EX_T(opline->op1.u.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr);
+ if (EX_T(opline->op1.var).var.ptr_ptr) {
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
} else {
switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.u.var).str_offset.str);
+ Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
}
}
- is_equal_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ is_equal_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
if (switch_expr_is_overloaded) {
/* We only free op1 if this is a string offset,
@@ -6036,8 +6105,8 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
* are allocated at each get_zval_ptr())
*/
zval_dtor(free_op1.var);
- EX_T(opline->op1.u.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.u.var).var.ptr = NULL;
+ EX_T(opline->op1.var).var.ptr_ptr = NULL;
+ EX_T(opline->op1.var).var.ptr = NULL;
}
ZEND_VM_NEXT_OPCODE();
}
@@ -6046,9 +6115,11 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPC
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *array_ptr = &EX_T(opline->result.u.var).tmp_var;
+ zval *array_ptr = &EX_T(opline->result.var).tmp_var;
zval *expr_ptr;
- zval *offset=&opline->op2.u.constant;
+ zval *offset=opline->op2.zv;
+ ulong hval;
+ long index;
#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV
zval **expr_ptr_ptr = NULL;
@@ -6057,10 +6128,10 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPC
expr_ptr_ptr=NULL;
expr_ptr = *expr_ptr_ptr;
} else {
- expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ expr_ptr=_get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
}
#else
- expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ expr_ptr=_get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
#endif
if (1) { /* temporary variable */
@@ -6091,14 +6162,22 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPC
if (offset) {
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL);
- break;
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ goto num_index;
case IS_LONG:
case IS_BOOL:
- zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
+ index = Z_LVAL_P(offset);
+num_index:
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), index, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
+ if (IS_CONST == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index);
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
+ }
+ zend_hash_quick_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
@@ -6125,7 +6204,7 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAN
{
zend_op *opline = EX(opline);
- array_init(&EX_T(opline->result.u.var).tmp_var);
+ array_init(&EX_T(opline->result.var).tmp_var);
if (IS_TMP_VAR == IS_UNUSED) {
ZEND_VM_NEXT_OPCODE();
#if 0 || IS_TMP_VAR != IS_UNUSED
@@ -6140,9 +6219,9 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- add_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ add_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -6153,9 +6232,9 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- sub_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ sub_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -6166,9 +6245,9 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- mul_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ mul_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -6179,9 +6258,9 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- div_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ div_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -6192,9 +6271,9 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- mod_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ mod_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -6205,9 +6284,9 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- shift_left_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ shift_left_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -6218,9 +6297,9 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- shift_right_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ shift_right_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -6231,9 +6310,9 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- concat_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ concat_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -6244,9 +6323,9 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAN
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- is_identical_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ is_identical_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -6256,11 +6335,11 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE
{
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
is_identical_function(result,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
Z_LVAL_P(result) = !Z_LVAL_P(result);
zval_dtor(free_op1.var);
zval_dtor(free_op2.var);
@@ -6271,11 +6350,11 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER
{
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) == 0));
zval_dtor(free_op1.var);
zval_dtor(free_op2.var);
@@ -6286,11 +6365,11 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAN
{
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) != 0));
zval_dtor(free_op1.var);
zval_dtor(free_op2.var);
@@ -6301,11 +6380,11 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDL
{
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) < 0));
zval_dtor(free_op1.var);
zval_dtor(free_op2.var);
@@ -6316,11 +6395,11 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_TMP_HANDLER(ZEND_OPC
{
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) <= 0));
zval_dtor(free_op1.var);
zval_dtor(free_op2.var);
@@ -6332,9 +6411,9 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- bitwise_or_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ bitwise_or_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -6345,9 +6424,9 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- bitwise_and_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ bitwise_and_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -6358,9 +6437,9 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -6371,9 +6450,9 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- boolean_xor_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ boolean_xor_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
zval_dtor(free_op2.var);
ZEND_VM_NEXT_OPCODE();
@@ -6383,8 +6462,8 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_
{
zend_op *opline = EX(opline);
zend_free_op free_op2;
- zval *str = &EX_T(opline->result.u.var).tmp_var;
- zval *var = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
+ zval *str = &EX_T(opline->result.var).tmp_var;
+ zval *var = _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC);
zval var_copy;
int use_copy = 0;
@@ -6430,7 +6509,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
- function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
+ function_name = _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC);
if (Z_TYPE_P(function_name)!=IS_STRING) {
zend_error_noreturn(E_ERROR, "Method name must be a string");
@@ -6439,7 +6518,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE
function_name_strval = Z_STRVAL_P(function_name);
function_name_strlen = Z_STRLEN_P(function_name);
- EX(object) = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ EX(object) = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) {
if (Z_OBJ_HT_P(EX(object))->get_method == NULL) {
@@ -6447,7 +6526,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE
}
/* First, locate the function. */
- EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC);
+ EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_TMP_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
if (!EX(fbc)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval);
}
@@ -6483,16 +6562,16 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_free_op free_op1, free_op2;
if (IS_TMP_VAR==IS_VAR) {
- if (EX_T(opline->op1.u.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr);
+ if (EX_T(opline->op1.var).var.ptr_ptr) {
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
} else {
switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.u.var).str_offset.str);
+ Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
}
}
- is_equal_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ is_equal_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op2.var);
if (switch_expr_is_overloaded) {
@@ -6502,8 +6581,8 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
* are allocated at each get_zval_ptr())
*/
zval_dtor(free_op1.var);
- EX_T(opline->op1.u.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.u.var).var.ptr = NULL;
+ EX_T(opline->op1.var).var.ptr_ptr = NULL;
+ EX_T(opline->op1.var).var.ptr = NULL;
}
ZEND_VM_NEXT_OPCODE();
}
@@ -6512,9 +6591,11 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCOD
{
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- zval *array_ptr = &EX_T(opline->result.u.var).tmp_var;
+ zval *array_ptr = &EX_T(opline->result.var).tmp_var;
zval *expr_ptr;
- zval *offset=_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
+ zval *offset=_get_zval_ptr_tmp(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC);
+ ulong hval;
+ long index;
#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV
zval **expr_ptr_ptr = NULL;
@@ -6523,10 +6604,10 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCOD
expr_ptr_ptr=NULL;
expr_ptr = *expr_ptr_ptr;
} else {
- expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ expr_ptr=_get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
}
#else
- expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ expr_ptr=_get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
#endif
if (1) { /* temporary variable */
@@ -6557,14 +6638,22 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCOD
if (offset) {
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL);
- break;
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ goto num_index;
case IS_LONG:
case IS_BOOL:
- zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
+ index = Z_LVAL_P(offset);
+num_index:
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), index, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
+ if (IS_TMP_VAR == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index);
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
+ }
+ zend_hash_quick_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
@@ -6591,7 +6680,7 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDL
{
zend_op *opline = EX(opline);
- array_init(&EX_T(opline->result.u.var).tmp_var);
+ array_init(&EX_T(opline->result.var).tmp_var);
if (IS_TMP_VAR == IS_UNUSED) {
ZEND_VM_NEXT_OPCODE();
#if 0 || IS_TMP_VAR != IS_UNUSED
@@ -6606,9 +6695,9 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- add_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ add_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -6619,9 +6708,9 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- sub_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ sub_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -6632,9 +6721,9 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- mul_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ mul_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -6645,9 +6734,9 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- div_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ div_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -6658,9 +6747,9 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- mod_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ mod_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -6671,9 +6760,9 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- shift_left_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ shift_left_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -6684,9 +6773,9 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- shift_right_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ shift_right_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -6697,9 +6786,9 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- concat_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ concat_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -6710,9 +6799,9 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAN
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- is_identical_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ is_identical_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -6722,11 +6811,11 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE
{
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
is_identical_function(result,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
Z_LVAL_P(result) = !Z_LVAL_P(result);
zval_dtor(free_op1.var);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
@@ -6737,11 +6826,11 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER
{
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) == 0));
zval_dtor(free_op1.var);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
@@ -6752,11 +6841,11 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAN
{
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) != 0));
zval_dtor(free_op1.var);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
@@ -6767,11 +6856,11 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDL
{
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) < 0));
zval_dtor(free_op1.var);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
@@ -6782,11 +6871,11 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPC
{
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) <= 0));
zval_dtor(free_op1.var);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
@@ -6798,9 +6887,9 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- bitwise_or_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ bitwise_or_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -6811,9 +6900,9 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- bitwise_and_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ bitwise_and_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -6824,9 +6913,9 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -6837,9 +6926,9 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- boolean_xor_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ boolean_xor_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
@@ -6849,8 +6938,8 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_
{
zend_op *opline = EX(opline);
zend_free_op free_op2;
- zval *str = &EX_T(opline->result.u.var).tmp_var;
- zval *var = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
+ zval *str = &EX_T(opline->result.var).tmp_var;
+ zval *var = _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC);
zval var_copy;
int use_copy = 0;
@@ -6896,7 +6985,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
- function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
+ function_name = _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC);
if (Z_TYPE_P(function_name)!=IS_STRING) {
zend_error_noreturn(E_ERROR, "Method name must be a string");
@@ -6905,7 +6994,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE
function_name_strval = Z_STRVAL_P(function_name);
function_name_strlen = Z_STRLEN_P(function_name);
- EX(object) = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ EX(object) = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) {
if (Z_OBJ_HT_P(EX(object))->get_method == NULL) {
@@ -6913,7 +7002,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE
}
/* First, locate the function. */
- EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC);
+ EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
if (!EX(fbc)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval);
}
@@ -6949,16 +7038,16 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_free_op free_op1, free_op2;
if (IS_TMP_VAR==IS_VAR) {
- if (EX_T(opline->op1.u.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr);
+ if (EX_T(opline->op1.var).var.ptr_ptr) {
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
} else {
switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.u.var).str_offset.str);
+ Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
}
}
- is_equal_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
+ is_equal_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
if (switch_expr_is_overloaded) {
@@ -6968,8 +7057,8 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
* are allocated at each get_zval_ptr())
*/
zval_dtor(free_op1.var);
- EX_T(opline->op1.u.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.u.var).var.ptr = NULL;
+ EX_T(opline->op1.var).var.ptr_ptr = NULL;
+ EX_T(opline->op1.var).var.ptr = NULL;
}
ZEND_VM_NEXT_OPCODE();
}
@@ -6978,9 +7067,11 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCOD
{
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
- zval *array_ptr = &EX_T(opline->result.u.var).tmp_var;
+ zval *array_ptr = &EX_T(opline->result.var).tmp_var;
zval *expr_ptr;
- zval *offset=_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
+ zval *offset=_get_zval_ptr_var(opline->op2.var, EX(Ts), &free_op2 TSRMLS_CC);
+ ulong hval;
+ long index;
#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV
zval **expr_ptr_ptr = NULL;
@@ -6989,10 +7080,10 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCOD
expr_ptr_ptr=NULL;
expr_ptr = *expr_ptr_ptr;
} else {
- expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ expr_ptr=_get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
}
#else
- expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ expr_ptr=_get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
#endif
if (1) { /* temporary variable */
@@ -7023,14 +7114,22 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCOD
if (offset) {
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL);
- break;
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ goto num_index;
case IS_LONG:
case IS_BOOL:
- zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
+ index = Z_LVAL_P(offset);
+num_index:
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), index, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
+ if (IS_VAR == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index);
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
+ }
+ zend_hash_quick_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
@@ -7057,7 +7156,7 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDL
{
zend_op *opline = EX(opline);
- array_init(&EX_T(opline->result.u.var).tmp_var);
+ array_init(&EX_T(opline->result.var).tmp_var);
if (IS_TMP_VAR == IS_UNUSED) {
ZEND_VM_NEXT_OPCODE();
#if 0 || IS_TMP_VAR != IS_UNUSED
@@ -7071,9 +7170,11 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OP
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *array_ptr = &EX_T(opline->result.u.var).tmp_var;
+ zval *array_ptr = &EX_T(opline->result.var).tmp_var;
zval *expr_ptr;
zval *offset=NULL;
+ ulong hval;
+ long index;
#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV
zval **expr_ptr_ptr = NULL;
@@ -7082,10 +7183,10 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OP
expr_ptr_ptr=NULL;
expr_ptr = *expr_ptr_ptr;
} else {
- expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ expr_ptr=_get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
}
#else
- expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ expr_ptr=_get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
#endif
if (1) { /* temporary variable */
@@ -7116,14 +7217,22 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OP
if (offset) {
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL);
- break;
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ goto num_index;
case IS_LONG:
case IS_BOOL:
- zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
+ index = Z_LVAL_P(offset);
+num_index:
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), index, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
+ if (IS_UNUSED == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index);
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
+ }
+ zend_hash_quick_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
@@ -7150,7 +7259,7 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HA
{
zend_op *opline = EX(opline);
- array_init(&EX_T(opline->result.u.var).tmp_var);
+ array_init(&EX_T(opline->result.var).tmp_var);
if (IS_TMP_VAR == IS_UNUSED) {
ZEND_VM_NEXT_OPCODE();
#if 0 || IS_TMP_VAR != IS_UNUSED
@@ -7165,9 +7274,9 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_op *opline = EX(opline);
zend_free_op free_op1;
- add_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ add_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -7178,9 +7287,9 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_op *opline = EX(opline);
zend_free_op free_op1;
- sub_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ sub_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -7191,9 +7300,9 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_op *opline = EX(opline);
zend_free_op free_op1;
- mul_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ mul_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -7204,9 +7313,9 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_op *opline = EX(opline);
zend_free_op free_op1;
- div_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ div_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -7217,9 +7326,9 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_op *opline = EX(opline);
zend_free_op free_op1;
- mod_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ mod_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -7230,9 +7339,9 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_op *opline = EX(opline);
zend_free_op free_op1;
- shift_left_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ shift_left_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -7243,9 +7352,9 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_op *opline = EX(opline);
zend_free_op free_op1;
- shift_right_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ shift_right_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -7256,9 +7365,9 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zend_free_op free_op1;
- concat_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ concat_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -7269,9 +7378,9 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HAND
zend_op *opline = EX(opline);
zend_free_op free_op1;
- is_identical_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ is_identical_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -7281,11 +7390,11 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
is_identical_function(result,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
Z_LVAL_P(result) = !Z_LVAL_P(result);
zval_dtor(free_op1.var);
@@ -7296,11 +7405,11 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) == 0));
zval_dtor(free_op1.var);
@@ -7311,11 +7420,11 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HAND
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) != 0));
zval_dtor(free_op1.var);
@@ -7326,11 +7435,11 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLE
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) < 0));
zval_dtor(free_op1.var);
@@ -7341,11 +7450,11 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_CV_HANDLER(ZEND_OPCO
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) <= 0));
zval_dtor(free_op1.var);
@@ -7357,9 +7466,9 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_op *opline = EX(opline);
zend_free_op free_op1;
- bitwise_or_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ bitwise_or_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -7370,9 +7479,9 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zend_free_op free_op1;
- bitwise_and_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ bitwise_and_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -7383,9 +7492,9 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zend_free_op free_op1;
- bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -7396,9 +7505,9 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_
zend_op *opline = EX(opline);
zend_free_op free_op1;
- boolean_xor_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ boolean_xor_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -7408,8 +7517,8 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_A
{
zend_op *opline = EX(opline);
- zval *str = &EX_T(opline->result.u.var).tmp_var;
- zval *var = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
+ zval *str = &EX_T(opline->result.var).tmp_var;
+ zval *var = _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC);
zval var_copy;
int use_copy = 0;
@@ -7454,7 +7563,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
- function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
+ function_name = _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC);
if (Z_TYPE_P(function_name)!=IS_STRING) {
zend_error_noreturn(E_ERROR, "Method name must be a string");
@@ -7463,7 +7572,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_
function_name_strval = Z_STRVAL_P(function_name);
function_name_strlen = Z_STRLEN_P(function_name);
- EX(object) = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ EX(object) = _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) {
if (Z_OBJ_HT_P(EX(object))->get_method == NULL) {
@@ -7471,7 +7580,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_
}
/* First, locate the function. */
- EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC);
+ EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_CV == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC);
if (!EX(fbc)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval);
}
@@ -7506,16 +7615,16 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zend_free_op free_op1;
if (IS_TMP_VAR==IS_VAR) {
- if (EX_T(opline->op1.u.var).var.ptr_ptr) {
- PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr);
+ if (EX_T(opline->op1.var).var.ptr_ptr) {
+ PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
} else {
switch_expr_is_overloaded = 1;
- Z_ADDREF_P(EX_T(opline->op1.u.var).str_offset.str);
+ Z_ADDREF_P(EX_T(opline->op1.var).str_offset.str);
}
}
- is_equal_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
+ is_equal_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ _get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC) TSRMLS_CC);
if (switch_expr_is_overloaded) {
/* We only free op1 if this is a string offset,
@@ -7524,8 +7633,8 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
* are allocated at each get_zval_ptr())
*/
zval_dtor(free_op1.var);
- EX_T(opline->op1.u.var).var.ptr_ptr = NULL;
- EX_T(opline->op1.u.var).var.ptr = NULL;
+ EX_T(opline->op1.var).var.ptr_ptr = NULL;
+ EX_T(opline->op1.var).var.ptr = NULL;
}
ZEND_VM_NEXT_OPCODE();
}
@@ -7534,9 +7643,11 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *array_ptr = &EX_T(opline->result.u.var).tmp_var;
+ zval *array_ptr = &EX_T(opline->result.var).tmp_var;
zval *expr_ptr;
- zval *offset=_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
+ zval *offset=_get_zval_ptr_cv(opline->op2.var, BP_VAR_R TSRMLS_CC);
+ ulong hval;
+ long index;
#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV
zval **expr_ptr_ptr = NULL;
@@ -7545,10 +7656,10 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE
expr_ptr_ptr=NULL;
expr_ptr = *expr_ptr_ptr;
} else {
- expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ expr_ptr=_get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
}
#else
- expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ expr_ptr=_get_zval_ptr_tmp(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
#endif
if (1) { /* temporary variable */
@@ -7579,14 +7690,22 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE
if (offset) {
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL);
- break;
+ index = zend_dval_to_lval(Z_DVAL_P(offset));
+ goto num_index;
case IS_LONG:
case IS_BOOL:
- zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
+ index = Z_LVAL_P(offset);
+num_index:
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), index, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
+ if (IS_CV == IS_CONST) {
+ hval = Z_HASH_P(offset);
+ } else {
+ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, index, goto num_index);
+ hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
+ }
+ zend_hash_quick_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
@@ -7613,7 +7732,7 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLE
{
zend_op *opline = EX(opline);
- array_init(&EX_T(opline->result.u.var).tmp_var);
+ array_init(&EX_T(opline->result.var).tmp_var);
if (IS_TMP_VAR == IS_UNUSED) {
ZEND_VM_NEXT_OPCODE();
#if 0 || IS_TMP_VAR != IS_UNUSED
@@ -7628,8 +7747,8 @@ static int ZEND_FASTCALL ZEND_BW_NOT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_op *opline = EX(opline);
zend_free_op free_op1;
- bitwise_not_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC) TSRMLS_CC);
+ bitwise_not_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC) TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -7639,8 +7758,8 @@ static int ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_op *opline = EX(opline);
zend_free_op free_op1;
- boolean_not_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC) TSRMLS_CC);
+ boolean_not_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC) TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -7649,14 +7768,14 @@ static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval **var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval **var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && !var_ptr) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
if (IS_VAR == IS_VAR && *var_ptr == EG(error_zval_ptr)) {
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, EG(uninitialized_zval_ptr));
+ if (RETURN_VALUE_USED(opline)) {
+ AI_SET_PTR(EX_T(opline->result.var).var, EG(uninitialized_zval_ptr));
PZVAL_LOCK(EG(uninitialized_zval_ptr));
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
@@ -7677,8 +7796,8 @@ static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
increment_function(*var_ptr);
}
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, *var_ptr);
+ if (RETURN_VALUE_USED(opline)) {
+ AI_SET_PTR(EX_T(opline->result.var).var, *var_ptr);
PZVAL_LOCK(*var_ptr);
}
@@ -7690,14 +7809,14 @@ static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval **var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval **var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && !var_ptr) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
if (IS_VAR == IS_VAR && *var_ptr == EG(error_zval_ptr)) {
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, EG(uninitialized_zval_ptr));
+ if (RETURN_VALUE_USED(opline)) {
+ AI_SET_PTR(EX_T(opline->result.var).var, EG(uninitialized_zval_ptr));
PZVAL_LOCK(EG(uninitialized_zval_ptr));
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
@@ -7718,8 +7837,8 @@ static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
decrement_function(*var_ptr);
}
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, *var_ptr);
+ if (RETURN_VALUE_USED(opline)) {
+ AI_SET_PTR(EX_T(opline->result.var).var, *var_ptr);
PZVAL_LOCK(*var_ptr);
}
@@ -7731,21 +7850,21 @@ static int ZEND_FASTCALL ZEND_POST_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval **var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval **var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && !var_ptr) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
if (IS_VAR == IS_VAR && *var_ptr == EG(error_zval_ptr)) {
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- EX_T(opline->result.u.var).tmp_var = *EG(uninitialized_zval_ptr);
+ if (RETURN_VALUE_USED(opline)) {
+ EX_T(opline->result.var).tmp_var = *EG(uninitialized_zval_ptr);
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
- EX_T(opline->result.u.var).tmp_var = **var_ptr;
- zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var);
+ EX_T(opline->result.var).tmp_var = **var_ptr;
+ zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var);
SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
@@ -7769,21 +7888,21 @@ static int ZEND_FASTCALL ZEND_POST_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval **var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval **var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && !var_ptr) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
if (IS_VAR == IS_VAR && *var_ptr == EG(error_zval_ptr)) {
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- EX_T(opline->result.u.var).tmp_var = *EG(uninitialized_zval_ptr);
+ if (RETURN_VALUE_USED(opline)) {
+ EX_T(opline->result.var).tmp_var = *EG(uninitialized_zval_ptr);
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
- EX_T(opline->result.u.var).tmp_var = **var_ptr;
- zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var);
+ EX_T(opline->result.var).tmp_var = **var_ptr;
+ zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var);
SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
@@ -7808,7 +7927,7 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_op *opline = EX(opline);
zend_free_op free_op1;
zval z_copy;
- zval *z = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *z = _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (IS_VAR != IS_CONST &&
Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL &&
@@ -7827,8 +7946,8 @@ static int ZEND_FASTCALL ZEND_PRINT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1;
- Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG;
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = 1;
+ Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_LONG;
return ZEND_ECHO_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
@@ -7837,10 +7956,11 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR(int type, ZEND_O
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *varname = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *varname = _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
zval **retval;
zval tmp_varname;
HashTable *target_symbol_table;
+ ulong hash_value;
if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
tmp_varname = *varname;
@@ -7849,17 +7969,23 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR(int type, ZEND_O
varname = &tmp_varname;
}
- if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
- retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC);
+ if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC_MEMBER) {
+ retval = zend_std_get_static_property(EX_T(opline->op2.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
} else {
- target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
/*
if (!target_symbol_table) {
ZEND_VM_NEXT_OPCODE();
}
*/
- if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &retval) == FAILURE) {
+ if (IS_VAR == IS_CONST) {
+ hash_value = Z_HASH_P(varname);
+ } else {
+ hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1);
+ }
+
+ if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) {
switch (type) {
case BP_VAR_R:
case BP_VAR_UNSET:
@@ -7875,13 +8001,13 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR(int type, ZEND_O
zval *new_zval = &EG(uninitialized_zval);
Z_ADDREF_P(new_zval);
- zend_hash_update(target_symbol_table, varname->value.str.val, varname->value.str.len+1, &new_zval, sizeof(zval *), (void **) &retval);
+ zend_hash_quick_update(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, &new_zval, sizeof(zval *), (void **) &retval);
}
break;
EMPTY_SWITCH_DEFAULT_CASE()
}
}
- switch (opline->op2.u.EA.type) {
+ switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) {
case ZEND_FETCH_GLOBAL:
if (IS_VAR != IS_TMP_VAR) {
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
@@ -7895,7 +8021,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR(int type, ZEND_O
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_VAR == IS_VAR && !free_op1.var) {
- PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr);
+ PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
}
break;
}
@@ -7905,7 +8031,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR(int type, ZEND_O
if (IS_VAR != IS_CONST && varname == &tmp_varname) {
zval_dtor(varname);
}
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
+ if (RETURN_VALUE_USED(opline)) {
if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
SEPARATE_ZVAL_TO_MAKE_IS_REF(retval);
}
@@ -7913,21 +8039,21 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR(int type, ZEND_O
switch (type) {
case BP_VAR_R:
case BP_VAR_IS:
- AI_SET_PTR(EX_T(opline->result.u.var).var, *retval);
+ AI_SET_PTR(EX_T(opline->result.var).var, *retval);
break;
case BP_VAR_UNSET: {
zend_free_op free_res;
- EX_T(opline->result.u.var).var.ptr_ptr = retval;
- PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res);
- if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
- SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr);
+ EX_T(opline->result.var).var.ptr_ptr = retval;
+ PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res);
+ if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
+ SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.var).var.ptr_ptr);
}
- PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr);
+ PZVAL_LOCK(*EX_T(opline->result.var).var.ptr_ptr);
FREE_OP_VAR_PTR(free_res);
break;
default:
- EX_T(opline->result.u.var).var.ptr_ptr = retval;
+ EX_T(opline->result.var).var.ptr_ptr = retval;
break;
}
}
@@ -7952,7 +8078,7 @@ static int ZEND_FASTCALL ZEND_FETCH_RW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- return zend_fetch_var_address_helper_SPEC_VAR(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), EX(opline)->extended_value)?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ return zend_fetch_var_address_helper_SPEC_VAR(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (EX(opline)->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -7969,7 +8095,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *val = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *val = _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
int ret;
if (IS_VAR == IS_TMP_VAR && Z_TYPE_P(val) == IS_BOOL) {
@@ -7983,9 +8109,9 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
if (!ret) {
#if DEBUG_ZEND>=2
- printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
+ printf("Conditional jmp to %d\n", opline->op2.opline_num);
#endif
- ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr);
+ ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
ZEND_VM_CONTINUE();
}
@@ -7996,7 +8122,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *val = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *val = _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
int ret;
if (IS_VAR == IS_TMP_VAR && Z_TYPE_P(val) == IS_BOOL) {
@@ -8010,9 +8136,9 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
if (ret) {
#if DEBUG_ZEND>=2
- printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
+ printf("Conditional jmp to %d\n", opline->op2.opline_num);
#endif
- ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr);
+ ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
ZEND_VM_CONTINUE();
}
@@ -8023,7 +8149,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *val = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *val = _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
int retval;
if (IS_VAR == IS_TMP_VAR && Z_TYPE_P(val) == IS_BOOL) {
@@ -8043,9 +8169,9 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ZEND_VM_CONTINUE(); /* CHECK_ME */
} else {
#if DEBUG_ZEND>=2
- printf("Conditional jmp on false to %d\n", opline->op2.u.opline_num);
+ printf("Conditional jmp on false to %d\n", opline->op2.opline_num);
#endif
- ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.u.opline_num]);
+ ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]);
ZEND_VM_CONTINUE(); /* CHECK_ME */
}
}
@@ -8054,7 +8180,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *val = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *val = _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
int retval;
if (IS_VAR == IS_TMP_VAR && Z_TYPE_P(val) == IS_BOOL) {
@@ -8066,13 +8192,13 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
ZEND_VM_CONTINUE();
}
}
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval;
- Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = retval;
+ Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
if (!retval) {
#if DEBUG_ZEND>=2
- printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
+ printf("Conditional jmp to %d\n", opline->op2.opline_num);
#endif
- ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr);
+ ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
ZEND_VM_CONTINUE();
}
ZEND_VM_NEXT_OPCODE();
@@ -8082,7 +8208,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *val = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *val = _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
int retval;
if (IS_VAR == IS_TMP_VAR && Z_TYPE_P(val) == IS_BOOL) {
@@ -8094,13 +8220,13 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZEND_VM_CONTINUE();
}
}
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval;
- Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = retval;
+ Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
if (retval) {
#if DEBUG_ZEND>=2
- printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
+ printf("Conditional jmp to %d\n", opline->op2.opline_num);
#endif
- ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr);
+ ZEND_VM_SET_OPCODE(opline->op2.jmp_addr);
ZEND_VM_CONTINUE();
}
ZEND_VM_NEXT_OPCODE();
@@ -8121,7 +8247,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
goto return_by_value;
}
- retval_ptr_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ retval_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && !retval_ptr_ptr) {
zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference");
@@ -8129,8 +8255,8 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (IS_VAR == IS_VAR && !Z_ISREF_PP(retval_ptr_ptr)) {
if (opline->extended_value == ZEND_RETURNS_FUNCTION &&
- EX_T(opline->op1.u.var).var.fcall_returned_reference) {
- } else if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) {
+ EX_T(opline->op1.var).var.fcall_returned_reference) {
+ } else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) {
if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) {
PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
}
@@ -8148,7 +8274,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
return_by_value:
- retval_ptr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ retval_ptr = _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (!EG(return_value_ptr_ptr)) {
if (IS_VAR == IS_TMP_VAR) {
@@ -8187,7 +8313,7 @@ static int ZEND_FASTCALL ZEND_THROW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *exception;
zend_free_op free_op1;
- value = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (IS_VAR == IS_CONST || Z_TYPE_P(value) != IS_OBJECT) {
zend_error_noreturn(E_ERROR, "Can only throw objects");
@@ -8210,15 +8336,15 @@ static int ZEND_FASTCALL ZEND_SEND_VAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
{
zend_op *opline = EX(opline);
if (opline->extended_value==ZEND_DO_FCALL_BY_NAME
- && ARG_MUST_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
- zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.u.opline_num);
+ && ARG_MUST_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
+ zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.opline_num);
}
{
zval *valptr;
zval *value;
zend_free_op free_op1;
- value = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ value = _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
ALLOC_ZVAL(valptr);
INIT_PZVAL_COPY(valptr, value);
@@ -8236,7 +8362,7 @@ static int ZEND_FASTCALL zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zval *varptr;
zend_free_op free_op1;
- varptr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ varptr = _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (varptr == &EG(uninitialized_zval)) {
ALLOC_ZVAL(varptr);
@@ -8268,21 +8394,21 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) {
return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
- } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
+ } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
if (IS_VAR == IS_VAR &&
(opline->extended_value & ZEND_ARG_SEND_FUNCTION) &&
- EX_T(opline->op1.u.var).var.fcall_returned_reference &&
- EX_T(opline->op1.u.var).var.ptr) {
- varptr = EX_T(opline->op1.u.var).var.ptr;
+ EX_T(opline->op1.var).var.fcall_returned_reference &&
+ EX_T(opline->op1.var).var.ptr) {
+ varptr = EX_T(opline->op1.var).var.ptr;
PZVAL_UNLOCK_EX(varptr, &free_op1, 0);
} else {
- varptr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ varptr = _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
}
if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) ||
- EX_T(opline->op1.u.var).var.fcall_returned_reference) &&
+ EX_T(opline->op1.var).var.fcall_returned_reference) &&
varptr != &EG(uninitialized_zval) &&
(PZVAL_IS_REF(varptr) ||
(Z_REFCOUNT_P(varptr) == 1 && (IS_VAR == IS_CV || free_op1.var)))) {
@@ -8294,7 +8420,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
- !ARG_MAY_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
+ !ARG_MAY_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
zend_error(E_STRICT, "Only variables should be passed by reference");
}
ALLOC_ZVAL(valptr);
@@ -8314,13 +8440,13 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_free_op free_op1;
zval **varptr_ptr;
zval *varptr;
- varptr_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ varptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && !varptr_ptr) {
zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
}
- if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
+ if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
@@ -8338,7 +8464,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_op *opline = EX(opline);
if ((opline->extended_value == ZEND_DO_FCALL_BY_NAME)
- && ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
+ && ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
return ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
@@ -8350,8 +8476,8 @@ static int ZEND_FASTCALL ZEND_BOOL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_free_op free_op1;
/* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = i_zend_is_true(_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC));
- Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = i_zend_is_true(_get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC));
+ Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
@@ -8361,7 +8487,7 @@ static int ZEND_FASTCALL ZEND_SWITCH_FREE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_
{
zend_op *opline = EX(opline);
- zend_switch_free(&EX_T(opline->op1.u.var), opline->extended_value TSRMLS_CC);
+ zend_switch_free(&EX_T(opline->op1.var), opline->extended_value TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
}
@@ -8369,7 +8495,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *obj = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *obj = _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
zend_class_entry *ce;
zend_function *clone;
zend_object_clone_obj_t clone_call;
@@ -8407,15 +8533,15 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
- EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
+ EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
if (!EG(exception)) {
- ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
- Z_OBJVAL_P(EX_T(opline->result.u.var).var.ptr) = clone_call(obj TSRMLS_CC);
- Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_OBJECT;
- Z_SET_REFCOUNT_P(EX_T(opline->result.u.var).var.ptr, 1);
- Z_SET_ISREF_P(EX_T(opline->result.u.var).var.ptr);
+ ALLOC_ZVAL(EX_T(opline->result.var).var.ptr);
+ Z_OBJVAL_P(EX_T(opline->result.var).var.ptr) = clone_call(obj TSRMLS_CC);
+ Z_TYPE_P(EX_T(opline->result.var).var.ptr) = IS_OBJECT;
+ Z_SET_REFCOUNT_P(EX_T(opline->result.var).var.ptr, 1);
+ Z_SET_ISREF_P(EX_T(opline->result.var).var.ptr);
if (!RETURN_VALUE_USED(opline) || EG(exception)) {
- zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
+ zval_ptr_dtor(&EX_T(opline->result.var).var.ptr);
}
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
@@ -8426,8 +8552,8 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *expr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *expr = _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *result = &EX_T(opline->result.var).tmp_var;
if (opline->extended_value != IS_STRING) {
*result = *expr;
@@ -8483,7 +8609,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
zend_op_array *new_op_array=NULL;
int return_value_used;
zend_free_op free_op1;
- zval *inc_filename = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *inc_filename = _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
zval tmp_inc_filename;
zend_bool failure_retval=0;
@@ -8496,7 +8622,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
return_value_used = RETURN_VALUE_USED(opline);
- switch (Z_LVAL(opline->op2.u.constant)) {
+ switch (opline->extended_value) {
case ZEND_INCLUDE_ONCE:
case ZEND_REQUIRE_ONCE: {
zend_file_handle file_handle;
@@ -8518,14 +8644,14 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
}
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
- new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
+ new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
zend_destroy_file_handle(&file_handle TSRMLS_CC);
} else {
zend_file_handle_dtor(&file_handle TSRMLS_CC);
failure_retval=1;
}
} else {
- if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) {
+ if (opline->extended_value == ZEND_INCLUDE_ONCE) {
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
} else {
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
@@ -8538,7 +8664,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
break;
case ZEND_INCLUDE:
case ZEND_REQUIRE:
- new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC);
+ new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
break;
case ZEND_EVAL: {
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
@@ -8553,12 +8679,12 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
zval_dtor(&tmp_inc_filename);
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
+ EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr;
if (new_op_array && !EG(exception)) {
EX(original_return_value) = EG(return_value_ptr_ptr);
- EG(return_value_ptr_ptr) = return_value_used ? EX_T(opline->result.u.var).var.ptr_ptr : NULL;
+ EG(return_value_ptr_ptr) = return_value_used ? EX_T(opline->result.var).var.ptr_ptr : NULL;
EG(active_op_array) = new_op_array;
- EX_T(opline->result.u.var).var.ptr = NULL;
+ EX_T(opline->result.var).var.ptr = NULL;
EX(current_object) = EX(object);
@@ -8580,11 +8706,11 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
EX(object) = EX(current_object);
if (return_value_used) {
- if (!EX_T(opline->result.u.var).var.ptr) { /* there was no return statement */
- ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
- INIT_PZVAL(EX_T(opline->result.u.var).var.ptr);
- Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = 1;
- Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL;
+ if (!EX_T(opline->result.var).var.ptr) { /* there was no return statement */
+ ALLOC_ZVAL(EX_T(opline->result.var).var.ptr);
+ INIT_PZVAL(EX_T(opline->result.var).var.ptr);
+ Z_LVAL_P(EX_T(opline->result.var).var.ptr) = 1;
+ Z_TYPE_P(EX_T(opline->result.var).var.ptr) = IS_BOOL;
}
}
@@ -8598,10 +8724,10 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
}
} else {
if (return_value_used) {
- ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
- INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr);
- Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = failure_retval;
- Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL;
+ ALLOC_ZVAL(EX_T(opline->result.var).var.ptr);
+ INIT_ZVAL(*EX_T(opline->result.var).var.ptr);
+ Z_LVAL_P(EX_T(opline->result.var).var.ptr) = failure_retval;
+ Z_TYPE_P(EX_T(opline->result.var).var.ptr) = IS_BOOL;
}
}
ZEND_VM_NEXT_OPCODE();
@@ -8617,7 +8743,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
if (IS_VAR == IS_CV && (opline->extended_value & ZEND_QUICK_SET)) {
if (EG(active_symbol_table)) {
zend_execute_data *ex = EX(prev_execute_data);
- zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.u.var);
+ zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
if (zend_hash_quick_del(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value) == SUCCESS) {
while (ex && ex->symbol_table == EG(active_symbol_table)) {
@@ -8636,17 +8762,17 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
ex = ex->prev_execute_data;
}
}
- EX(CVs)[opline->op1.u.var] = NULL;
- } else if (EX(CVs)[opline->op1.u.var]) {
- zval_ptr_dtor(EX(CVs)[opline->op1.u.var]);
- EX(CVs)[opline->op1.u.var] = NULL;
+ EX(CVs)[opline->op1.var] = NULL;
+ } else if (EX(CVs)[opline->op1.var]) {
+ zval_ptr_dtor(EX(CVs)[opline->op1.var]);
+ EX(CVs)[opline->op1.var] = NULL;
}
ZEND_VM_NEXT_OPCODE();
}
- varname = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ varname = _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
- if (Z_TYPE_P(varname) != IS_STRING) {
+ if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
tmp = *varname;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
@@ -8655,12 +8781,12 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
Z_ADDREF_P(varname);
}
- if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
- zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname) TSRMLS_CC);
+ if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC_MEMBER) {
+ zend_std_unset_static_property(EX_T(opline->op2.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
} else {
ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
- target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
if (zend_hash_quick_del(target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value) == SUCCESS) {
zend_execute_data *ex = execute_data;
@@ -8702,13 +8828,13 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_bool is_empty = 0;
if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
- array_ptr_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ array_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) {
ALLOC_INIT_ZVAL(array_ptr);
} else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) {
if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) {
zend_error(E_WARNING, "foreach() cannot iterate over objects without PHP class");
- ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
+ ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
}
ce = Z_OBJCE_PP(array_ptr_ptr);
@@ -8728,7 +8854,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
Z_ADDREF_P(array_ptr);
}
} else {
- array_ptr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ array_ptr = _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (0) { /* IS_TMP_VAR */
zval *tmp;
@@ -8780,7 +8906,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
}
- AI_SET_PTR(EX_T(opline->result.u.var).var, array_ptr);
+ AI_SET_PTR(EX_T(opline->result.var).var, array_ptr);
PZVAL_LOCK(array_ptr);
if (iter) {
@@ -8830,7 +8956,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
}
is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS;
- zend_hash_get_pointer(fe_ht, &EX_T(opline->result.u.var).fe.fe_pos);
+ zend_hash_get_pointer(fe_ht, &EX_T(opline->result.var).fe.fe_pos);
} else {
zend_error(E_WARNING, "Invalid argument supplied for foreach()");
is_empty = 1;
@@ -8842,7 +8968,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
}
if (is_empty) {
- ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
+ ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
} else {
ZEND_VM_NEXT_OPCODE();
}
@@ -8852,7 +8978,7 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
{
zend_op *opline = EX(opline);
- zval *array = EX_T(opline->op1.u.var).var.ptr;
+ zval *array = EX_T(opline->op1.var).var.ptr;
zval **value;
char *str_key;
uint str_key_len;
@@ -8866,18 +8992,18 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
default:
case ZEND_ITER_INVALID:
zend_error(E_WARNING, "Invalid argument supplied for foreach()");
- ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
+ ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
case ZEND_ITER_PLAIN_OBJECT: {
char *class_name, *prop_name;
zend_object *zobj = zend_objects_get_address(array TSRMLS_CC);
fe_ht = HASH_OF(array);
- zend_hash_set_pointer(fe_ht, &EX_T(opline->op1.u.var).fe.fe_pos);
+ zend_hash_set_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
do {
if (zend_hash_get_current_data(fe_ht, (void **) &value)==FAILURE) {
/* reached end of iteration */
- ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
+ ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
}
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
@@ -8885,7 +9011,7 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
} while (key_type == HASH_KEY_NON_EXISTANT ||
(key_type != HASH_KEY_IS_LONG &&
zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) != SUCCESS));
- zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.u.var).fe.fe_pos);
+ zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
if (use_key && key_type != HASH_KEY_IS_LONG) {
zend_unmangle_property_name(str_key, str_key_len-1, &class_name, &prop_name);
str_key_len = strlen(prop_name);
@@ -8897,16 +9023,16 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
case ZEND_ITER_PLAIN_ARRAY:
fe_ht = HASH_OF(array);
- zend_hash_set_pointer(fe_ht, &EX_T(opline->op1.u.var).fe.fe_pos);
+ zend_hash_set_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
if (zend_hash_get_current_data(fe_ht, (void **) &value)==FAILURE) {
/* reached end of iteration */
- ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
+ ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
}
if (use_key) {
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 1, NULL);
}
zend_hash_move_forward(fe_ht);
- zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.u.var).fe.fe_pos);
+ zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
break;
case ZEND_ITER_OBJECT:
@@ -8929,7 +9055,7 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
zval_ptr_dtor(&array);
ZEND_VM_NEXT_OPCODE();
}
- ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
+ ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
}
iter->funcs->get_current_data(iter, &value TSRMLS_CC);
if (EG(exception)) {
@@ -8939,7 +9065,7 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
if (!value) {
/* failure in get_current_data */
- ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
+ ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
}
if (use_key) {
if (iter->funcs->get_current_key) {
@@ -8960,16 +9086,16 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
if (opline->extended_value & ZEND_FE_FETCH_BYREF) {
SEPARATE_ZVAL_IF_NOT_REF(value);
Z_SET_ISREF_PP(value);
- EX_T(opline->result.u.var).var.ptr_ptr = value;
+ EX_T(opline->result.var).var.ptr_ptr = value;
Z_ADDREF_PP(value);
} else {
- AI_SET_PTR(EX_T(opline->result.u.var).var, *value);
+ AI_SET_PTR(EX_T(opline->result.var).var, *value);
PZVAL_LOCK(*value);
}
if (use_key) {
zend_op *op_data = opline+1;
- zval *key = &EX_T(op_data->result.u.var).tmp_var;
+ zval *key = &EX_T(op_data->result.var).tmp_var;
switch (key_type) {
case HASH_KEY_IS_STRING:
@@ -8999,10 +9125,10 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HA
zend_bool isset = 1;
if (IS_VAR == IS_CV && (opline->extended_value & ZEND_QUICK_SET)) {
- if (EX(CVs)[opline->op1.u.var]) {
- value = EX(CVs)[opline->op1.u.var];
+ if (EX(CVs)[opline->op1.var]) {
+ value = EX(CVs)[opline->op1.var];
} else if (EG(active_symbol_table)) {
- zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.u.var);
+ zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
isset = 0;
@@ -9013,22 +9139,22 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HA
} else {
HashTable *target_symbol_table;
zend_free_op free_op1;
- zval tmp, *varname = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval tmp, *varname = _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
- if (Z_TYPE_P(varname) != IS_STRING) {
+ if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
tmp = *varname;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
varname = &tmp;
}
- if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
- value = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1 TSRMLS_CC);
+ if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC_MEMBER) {
+ value = zend_std_get_static_property(EX_T(opline->op2.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1, ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
if (!value) {
isset = 0;
}
} else {
- target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) {
isset = 0;
}
@@ -9040,23 +9166,20 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HA
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
}
- Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
+ Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL;
- switch (opline->extended_value & ZEND_ISSET_ISEMPTY_MASK) {
- case ZEND_ISSET:
- if (isset && Z_TYPE_PP(value) == IS_NULL) {
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0;
- } else {
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = isset;
- }
- break;
- case ZEND_ISEMPTY:
- if (!isset || !i_zend_is_true(*value)) {
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1;
- } else {
- Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0;
- }
- break;
+ if (opline->extended_value & ZEND_ISSET) {
+ if (isset && Z_TYPE_PP(value) == IS_NULL) {
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = 0;
+ } else {
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = isset;
+ }
+ } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
+ if (!isset || !i_zend_is_true(*value)) {
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = 1;
+ } else {
+ Z_LVAL(EX_T(opline->result.var).tmp_var) = 0;
+ }
}
ZEND_VM_NEXT_OPCODE();
@@ -9068,7 +9191,7 @@ static int ZEND_FASTCALL ZEND_EXIT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_op *opline = EX(opline);
if (IS_VAR != IS_UNUSED) {
zend_free_op free_op1;
- zval *ptr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *ptr = _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (Z_TYPE_P(ptr) == IS_LONG) {
EG(exit_status) = Z_LVAL_P(ptr);
@@ -9086,16 +9209,16 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *value = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *value = _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (i_zend_is_true(value)) {
- EX_T(opline->result.u.var).tmp_var = *value;
- zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var);
+ EX_T(opline->result.var).tmp_var = *value;
+ zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
#if DEBUG_ZEND>=2
- printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
+ printf("Conditional jmp to %d\n", opline->op2.opline_num);
#endif
- ZEND_VM_JMP(opline->op2.u.jmp_addr);
+ ZEND_VM_JMP(opline->op2.jmp_addr);
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
@@ -9106,11 +9229,11 @@ static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *value = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *value = _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
- EX_T(opline->result.u.var).tmp_var = *value;
+ EX_T(opline->result.var).tmp_var = *value;
if (!0) {
- zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var);
+ zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
@@ -9120,15 +9243,15 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *expr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *expr = _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
zend_bool result;
if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) {
- result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.u.var).class_entry TSRMLS_CC);
+ result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.var).class_entry TSRMLS_CC);
} else {
result = 0;
}
- ZVAL_BOOL(&EX_T(opline->result.u.var).tmp_var, result);
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -9138,9 +9261,9 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zend_free_op free_op1;
- add_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ add_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
@@ -9151,9 +9274,9 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zend_free_op free_op1;
- sub_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ sub_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
@@ -9164,9 +9287,9 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zend_free_op free_op1;
- mul_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ mul_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
@@ -9177,9 +9300,9 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zend_free_op free_op1;
- div_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ div_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
@@ -9190,9 +9313,9 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
zend_op *opline = EX(opline);
zend_free_op free_op1;
- mod_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ mod_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
@@ -9203,9 +9326,9 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_op *opline = EX(opline);
zend_free_op free_op1;
- shift_left_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ shift_left_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
@@ -9216,9 +9339,9 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_op *opline = EX(opline);
zend_free_op free_op1;
- shift_right_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ shift_right_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
@@ -9229,9 +9352,9 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER
zend_op *opline = EX(opline);
zend_free_op free_op1;
- concat_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ concat_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
@@ -9242,9 +9365,9 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
zend_op *opline = EX(opline);
zend_free_op free_op1;
- is_identical_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ is_identical_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
@@ -9254,11 +9377,11 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCO
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
is_identical_function(result,
- _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
Z_LVAL_P(result) = !Z_LVAL_P(result);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
@@ -9269,11 +9392,11 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDL
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) == 0));
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
@@ -9284,11 +9407,11 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) != 0));
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
@@ -9299,11 +9422,11 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) < 0));
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
@@ -9314,11 +9437,11 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_O
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *result = &EX_T(opline->result.u.var).tmp_var;
+ zval *result = &EX_T(opline->result.var).tmp_var;
compare_function(result,
- _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) <= 0));
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
@@ -9330,9 +9453,9 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_
zend_op *opline = EX(opline);
zend_free_op free_op1;
- bitwise_or_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ bitwise_or_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
@@ -9343,9 +9466,9 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER
zend_op *opline = EX(opline);
zend_free_op free_op1;
- bitwise_and_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ bitwise_and_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
@@ -9356,9 +9479,9 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER
zend_op *opline = EX(opline);
zend_free_op free_op1;
- bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ bitwise_xor_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
@@ -9369,9 +9492,9 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDL
zend_op *opline = EX(opline);
zend_free_op free_op1;
- boolean_xor_function(&EX_T(opline->result.u.var).tmp_var,
- _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC),
- &opline->op2.u.constant TSRMLS_CC);
+ boolean_xor_function(&EX_T(opline->result.var).tmp_var,
+ _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC),
+ opline->op2.zv TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
@@ -9382,18 +9505,18 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
zend_op *opline = EX(opline);
zend_op *op_data = opline+1;
zend_free_op free_op1, free_op_data1;
- zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval **object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
zval *object;
- zval *property = &opline->op2.u.constant;
- zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R);
- znode *result = &opline->result;
+ zval *property = opline->op2.zv;
+ zval *value = get_zval_ptr(op_data->op1_type, &op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R);
+ znode_op *result = &opline->result;
int have_get_ptr = 0;
if (IS_VAR == IS_VAR && !object_ptr) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- EX_T(result->u.var).var.ptr_ptr = NULL;
+ EX_T(result->var).var.ptr_ptr = NULL;
make_real_object(object_ptr TSRMLS_CC);
object = *object_ptr;
@@ -9402,9 +9525,9 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
FREE_OP(free_op_data1);
- if (!RETURN_VALUE_UNUSED(result)) {
- EX_T(result->u.var).var.ptr = EG(uninitialized_zval_ptr);
- EX_T(result->u.var).var.ptr_ptr = NULL;
+ if (RETURN_VALUE_USED(opline)) {
+ EX_T(result->var).var.ptr = EG(uninitialized_zval_ptr);
+ EX_T(result->var).var.ptr_ptr = NULL;
PZVAL_LOCK(EG(uninitialized_zval_ptr));
}
} else {
@@ -9416,15 +9539,15 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
/* here property is a string */
if (opline->extended_value == ZEND_ASSIGN_OBJ
&& Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
- zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC);
+ zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (zptr != NULL) { /* NULL means no success in getting PTR */
SEPARATE_ZVAL_IF_NOT_REF(zptr);
have_get_ptr = 1;
binary_op(*zptr, *zptr, value TSRMLS_CC);
- if (!RETURN_VALUE_UNUSED(result)) {
- EX_T(result->u.var).var.ptr = *zptr;
- EX_T(result->u.var).var.ptr_ptr = NULL;
+ if (RETURN_VALUE_USED(opline)) {
+ EX_T(result->var).var.ptr = *zptr;
+ EX_T(result->var).var.ptr_ptr = NULL;
PZVAL_LOCK(*zptr);
}
}
@@ -9435,7 +9558,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
if (Z_OBJ_HT_P(object)->read_property) {
- z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
+ z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
}
} else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
if (Z_OBJ_HT_P(object)->read_dimension) {
@@ -9457,21 +9580,21 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
SEPARATE_ZVAL_IF_NOT_REF(&z);
binary_op(z, z, value TSRMLS_CC);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
- Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
} else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC);
}
- if (!RETURN_VALUE_UNUSED(result)) {
- EX_T(result->u.var).var.ptr = z;
- EX_T(result->u.var).var.ptr_ptr = NULL;
+ if (RETURN_VALUE_USED(opline)) {
+ EX_T(result->var).var.ptr = z;
+ EX_T(result->var).var.ptr_ptr = NULL;
PZVAL_LOCK(z);
}
zval_ptr_dtor(&z);
} else {
zend_error(E_WARNING, "Attempt to assign property of non-object");
- if (!RETURN_VALUE_UNUSED(result)) {
- EX_T(result->u.var).var.ptr = EG(uninitialized_zval_ptr);
- EX_T(result->u.var).var.ptr_ptr = NULL;
+ if (RETURN_VALUE_USED(opline)) {
+ EX_T(result->var).var.ptr = EG(uninitialized_zval_ptr);
+ EX_T(result->var).var.ptr_ptr = NULL;
PZVAL_LOCK(EG(uninitialized_zval_ptr));
}
}
@@ -9503,7 +9626,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CONST(int (*binar
return zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
break;
case ZEND_ASSIGN_DIM: {
- zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && !container) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
@@ -9514,18 +9637,18 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CONST(int (*binar
return zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} else {
zend_op *op_data = opline+1;
- zval *dim = &opline->op2.u.constant;
+ zval *dim = opline->op2.zv;
- zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), container, dim, 0, BP_VAR_RW TSRMLS_CC);
- value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R);
- var_ptr = _get_zval_ptr_ptr_var(&op_data->op2, EX(Ts), &free_op_data2 TSRMLS_CC);
+ zend_fetch_dimension_address(&EX_T(op_data->op2.var), container, dim, IS_CONST, BP_VAR_RW TSRMLS_CC);
+ value = get_zval_ptr(op_data->op1_type, &op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R);
+ var_ptr = _get_zval_ptr_ptr_var(op_data->op2.var, EX(Ts), &free_op_data2 TSRMLS_CC);
ZEND_VM_INC_OPCODE();
}
}
break;
default:
- value = &opline->op2.u.constant;
- var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ value = opline->op2.zv;
+ var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
/* do nothing */
break;
}
@@ -9535,8 +9658,8 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CONST(int (*binar
}
if (*var_ptr == EG(error_zval_ptr)) {
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, EG(uninitialized_zval_ptr));
+ if (RETURN_VALUE_USED(opline)) {
+ AI_SET_PTR(EX_T(opline->result.var).var, EG(uninitialized_zval_ptr));
PZVAL_LOCK(EG(uninitialized_zval_ptr));
}
@@ -9558,8 +9681,8 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CONST(int (*binar
binary_op(*var_ptr, *var_ptr, value TSRMLS_CC);
}
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, *var_ptr);
+ if (RETURN_VALUE_USED(opline)) {
+ AI_SET_PTR(EX_T(opline->result.var).var, *var_ptr);
PZVAL_LOCK(*var_ptr);
}
@@ -9630,10 +9753,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval **object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
zval *object;
- zval *property = &opline->op2.u.constant;
- zval **retval = &EX_T(opline->result.u.var).var.ptr;
+ zval *property = opline->op2.zv;
+ zval **retval = &EX_T(opline->result.var).var.ptr;
int have_get_ptr = 0;
if (IS_VAR == IS_VAR && !object_ptr) {
@@ -9646,7 +9769,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t
if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
+ if (RETURN_VALUE_USED(opline)) {
*retval = EG(uninitialized_zval_ptr);
PZVAL_LOCK(*retval);
}
@@ -9661,13 +9784,13 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t
}
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
- zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC);
+ zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (zptr != NULL) { /* NULL means no success in getting PTR */
SEPARATE_ZVAL_IF_NOT_REF(zptr);
have_get_ptr = 1;
incdec_op(*zptr);
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
+ if (RETURN_VALUE_USED(opline)) {
*retval = *zptr;
PZVAL_LOCK(*retval);
}
@@ -9676,7 +9799,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
- zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -9692,12 +9815,12 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t
SEPARATE_ZVAL_IF_NOT_REF(&z);
incdec_op(z);
*retval = z;
- Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC);
- SELECTIVE_PZVAL_LOCK(*retval, &opline->result);
+ Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
+ SELECTIVE_PZVAL_LOCK(*retval, opline);
zval_ptr_dtor(&z);
} else {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
+ if (RETURN_VALUE_USED(opline)) {
*retval = EG(uninitialized_zval_ptr);
PZVAL_LOCK(*retval);
}
@@ -9727,10 +9850,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval **object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
zval *object;
- zval *property = &opline->op2.u.constant;
- zval *retval = &EX_T(opline->result.u.var).tmp_var;
+ zval *property = opline->op2.zv;
+ zval *retval = &EX_T(opline->result.var).tmp_var;
int have_get_ptr = 0;
if (IS_VAR == IS_VAR && !object_ptr) {
@@ -9755,7 +9878,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_
}
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
- zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC);
+ zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (zptr != NULL) { /* NULL means no success in getting PTR */
have_get_ptr = 1;
SEPARATE_ZVAL_IF_NOT_REF(zptr);
@@ -9770,7 +9893,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
- zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z_copy;
if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
@@ -9791,7 +9914,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_
INIT_PZVAL(z_copy);
incdec_op(z_copy);
Z_ADDREF_P(z);
- Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(&z);
} else {
@@ -9823,19 +9946,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *dim = &opline->op2.u.constant;
+ zval *dim = opline->op2.zv;
zval **container;
- if (opline->extended_value == ZEND_FETCH_ADD_LOCK &&
+ if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
IS_VAR != IS_CV &&
- EX_T(opline->op1.u.var).var.ptr_ptr) {
- PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr);
+ EX_T(opline->op1.var).var.ptr_ptr) {
+ PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
}
- container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && !container) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_read(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_R TSRMLS_CC);
+ zend_fetch_dimension_address_read(!RETURN_VALUE_USED(opline)?NULL:&EX_T(opline->result.var), container, dim, IS_CONST, BP_VAR_R TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
@@ -9845,29 +9968,29 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *dim = &opline->op2.u.constant;
- zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *dim = opline->op2.zv;
+ zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && !container) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address(&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_W TSRMLS_CC);
+ zend_fetch_dimension_address(&EX_T(opline->result.var), container, dim, IS_CONST, BP_VAR_W TSRMLS_CC);
if (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
READY_TO_DESTROY(free_op1.var)) {
- AI_USE_PTR(EX_T(opline->result.u.var).var);
- if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) &&
- Z_REFCOUNT_PP(EX_T(opline->result.u.var).var.ptr_ptr) > 2) {
- SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr);
+ AI_USE_PTR(EX_T(opline->result.var).var);
+ if (!PZVAL_IS_REF(*EX_T(opline->result.var).var.ptr_ptr) &&
+ Z_REFCOUNT_PP(EX_T(opline->result.var).var.ptr_ptr) > 2) {
+ SEPARATE_ZVAL(EX_T(opline->result.var).var.ptr_ptr);
}
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
/* We are going to assign the result by reference */
- if (opline->extended_value && EX_T(opline->result.u.var).var.ptr_ptr) {
- Z_DELREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
- SEPARATE_ZVAL_TO_MAKE_IS_REF(EX_T(opline->result.u.var).var.ptr_ptr);
- Z_ADDREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
+ if (opline->extended_value && EX_T(opline->result.var).var.ptr_ptr) {
+ Z_DELREF_PP(EX_T(opline->result.var).var.ptr_ptr);
+ SEPARATE_ZVAL_TO_MAKE_IS_REF(EX_T(opline->result.var).var.ptr_ptr);
+ Z_ADDREF_PP(EX_T(opline->result.var).var.ptr_ptr);
}
ZEND_VM_NEXT_OPCODE();
@@ -9877,20 +10000,20 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *dim = &opline->op2.u.constant;
- zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *dim = opline->op2.zv;
+ zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && !container) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address(&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_RW TSRMLS_CC);
+ zend_fetch_dimension_address(&EX_T(opline->result.var), container, dim, IS_CONST, BP_VAR_RW TSRMLS_CC);
if (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
READY_TO_DESTROY(free_op1.var)) {
- AI_USE_PTR(EX_T(opline->result.u.var).var);
- if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) &&
- Z_REFCOUNT_PP(EX_T(opline->result.u.var).var.ptr_ptr) > 2) {
- SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr);
+ AI_USE_PTR(EX_T(opline->result.var).var);
+ if (!PZVAL_IS_REF(*EX_T(opline->result.var).var.ptr_ptr) &&
+ Z_REFCOUNT_PP(EX_T(opline->result.var).var.ptr_ptr) > 2) {
+ SEPARATE_ZVAL(EX_T(opline->result.var).var.ptr_ptr);
}
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
@@ -9901,13 +10024,13 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *dim = &opline->op2.u.constant;
- zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *dim = opline->op2.zv;
+ zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && !container) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_read(&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_IS TSRMLS_CC);
+ zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, dim, IS_CONST, BP_VAR_IS TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
@@ -9917,32 +10040,32 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *dim = &opline->op2.u.constant;
+ zval *dim = opline->op2.zv;
zval **container;
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) {
- container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
+ container = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && !container) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address(&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_W TSRMLS_CC);
+ zend_fetch_dimension_address(&EX_T(opline->result.var), container, dim, IS_CONST, BP_VAR_W TSRMLS_CC);
if (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
READY_TO_DESTROY(free_op1.var)) {
- AI_USE_PTR(EX_T(opline->result.u.var).var);
- if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) &&
- Z_REFCOUNT_PP(EX_T(opline->result.u.var).var.ptr_ptr) > 2) {
- SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr);
+ AI_USE_PTR(EX_T(opline->result.var).var);
+ if (!PZVAL_IS_REF(*EX_T(opline->result.var).var.ptr_ptr) &&
+ Z_REFCOUNT_PP(EX_T(opline->result.var).var.ptr_ptr) > 2) {
+ SEPARATE_ZVAL(EX_T(opline->result.var).var.ptr_ptr);
}
}
} else {
if (IS_CONST == IS_UNUSED) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
- container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && !container) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_read(&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_R TSRMLS_CC);
+ zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, dim, IS_CONST, BP_VAR_R TSRMLS_CC);
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
@@ -9953,12 +10076,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCOD
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
- zval *dim = &opline->op2.u.constant;
+ zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *dim = opline->op2.zv;
/* Not needed in DIM_UNSET
- if (opline->extended_value == ZEND_FETCH_ADD_LOCK) {
- PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr);
+ if (opline->extended_value & ZEND_FETCH_ADD_LOCK) {
+ PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
}
*/
if (IS_VAR == IS_CV) {
@@ -9969,27 +10092,27 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCOD
if (IS_VAR == IS_VAR && !container) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address(&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_UNSET TSRMLS_CC);
+ zend_fetch_dimension_address(&EX_T(opline->result.var), container, dim, IS_CONST, BP_VAR_UNSET TSRMLS_CC);
if (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
READY_TO_DESTROY(free_op1.var)) {
- AI_USE_PTR(EX_T(opline->result.u.var).var);
- if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) &&
- Z_REFCOUNT_PP(EX_T(opline->result.u.var).var.ptr_ptr) > 2) {
- SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr);
+ AI_USE_PTR(EX_T(opline->result.var).var);
+ if (!PZVAL_IS_REF(*EX_T(opline->result.var).var.ptr_ptr) &&
+ Z_REFCOUNT_PP(EX_T(opline->result.var).var.ptr_ptr) > 2) {
+ SEPARATE_ZVAL(EX_T(opline->result.var).var.ptr_ptr);
}
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) {
+ if (EX_T(opline->result.var).var.ptr_ptr == NULL) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
} else {
zend_free_op free_res;
- PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res);
- if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
- SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr);
+ PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res);
+ if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
+ SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.var).var.ptr_ptr);
}
- PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr);
+ PZVAL_LOCK(*EX_T(opline->result.var).var.ptr_ptr);
FREE_OP_VAR_PTR(free_res);
}
ZEND_VM_NEXT_OPCODE();
@@ -9999,16 +10122,16 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CONST(
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *container = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *container = _get_zval_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
- zval *offset = &opline->op2.u.constant;
+ zval *offset = opline->op2.zv;
if (Z_TYPE_P(container) != 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");
}
- if (!RETURN_VALUE_UNUSED(&opline->result)) {
- AI_SET_PTR(EX_T(opline->result.u.var).var, EG(uninitialized_zval_ptr));
+ if (RETURN_VALUE_USED(opline)) {
+ AI_SET_PTR(EX_T(opline->result.var).var, EG(uninitialized_zval_ptr));
PZVAL_LOCK(EG(uninitialized_zval_ptr));
}
@@ -10020,16 +10143,16 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CONST(
}
/* here we are sure we are dealing with an object */
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, type, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
- if (RETURN_VALUE_UNUSED(&opline->result)) {
+ if (!RETURN_VALUE_USED(opline)) {
if (Z_REFCOUNT_P(retval) == 0) {
GC_REMOVE_ZVAL_FROM_BUFFER(retval);
zval_dtor(retval);
FREE_ZVAL(retval);
}
} else {
- AI_SET_PTR(EX_T(opline->result.u.var).var, retval);
+ AI_SET_PTR(EX_T(opline->result.var).var, retval);
PZVAL_LOCK(retval);
}
@@ -10053,22 +10176,22 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *property = &opline->op2.u.constant;
+ zval *property = opline->op2.zv;
zval **container;
if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
- PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr);
- EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr;
+ PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
+ EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr;
}
if (0) {
MAKE_REAL_ZVAL_PTR(property);
}
- container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ container = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && !container) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(&EX_T(opline->result.u.var), container, property, BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
if (0) {
zval_ptr_dtor(&property);
} else {
@@ -10076,19 +10199,19 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA
}
if (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
READY_TO_DESTROY(free_op1.var)) {
- AI_USE_PTR(EX_T(opline->result.u.var).var);
- if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) &&
- Z_REFCOUNT_PP(EX_T(opline->result.u.var).var.ptr_ptr) > 2) {
- SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr);
+ AI_USE_PTR(EX_T(opline->result.var).var);
+ if (!PZVAL_IS_REF(*EX_T(opline->result.var).var.ptr_ptr) &&
+ Z_REFCOUNT_PP(EX_T(opline->result.var).var.ptr_ptr) > 2) {
+ SEPARATE_ZVAL(EX_T(opline->result.var).var.ptr_ptr);
}
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
/* We are going to assign the result by reference */
if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
- Z_DELREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
- SEPARATE_ZVAL_TO_MAKE_IS_REF(EX_T(opline->result.u.var).var.ptr_ptr);
- Z_ADDREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
+ Z_DELREF_PP(EX_T(opline->result.var).var.ptr_ptr);
+ SEPARATE_ZVAL_TO_MAKE_IS_REF(EX_T(opline->result.var).var.ptr_ptr);
+ Z_ADDREF_PP(EX_T(opline->result.var).var.ptr_ptr);
}
ZEND_VM_NEXT_OPCODE();
@@ -10098,8 +10221,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
- zval *property = &opline->op2.u.constant;
- zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *property = opline->op2.zv;
+ zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (0) {
MAKE_REAL_ZVAL_PTR(property);
@@ -10107,7 +10230,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
if (IS_VAR == IS_VAR && !container) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(&EX_T(opline->result.u.var), container, property, BP_VAR_RW TSRMLS_CC);
+ zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_RW TSRMLS_CC);
if (0) {
zval_ptr_dtor(&property);
} else {
@@ -10115,10 +10238,10 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
}
if (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
READY_TO_DESTROY(free_op1.var)) {
- AI_USE_PTR(EX_T(opline->result.u.var).var);
- if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) &&
- Z_REFCOUNT_PP(EX_T(opline->result.u.var).var.ptr_ptr) > 2) {
- SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr);
+ AI_USE_PTR(EX_T(opline->result.var).var);
+ if (!PZVAL_IS_REF(*EX_T(opline->result.var).var.ptr_ptr) &&
+ Z_REFCOUNT_PP(EX_T(opline->result.var).var.ptr_ptr) > 2) {
+ SEPARATE_ZVAL(EX_T(opline->result.var).var.ptr_ptr);
}
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
@@ -10134,11 +10257,11 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP
{
zend_op *opline = EX(opline);
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) {
+ if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1;
- zval *property = &opline->op2.u.constant;
- zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *property = opline->op2.zv;
+ zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (0) {
MAKE_REAL_ZVAL_PTR(property);
@@ -10146,7 +10269,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP
if (IS_VAR == IS_VAR && !container) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(&EX_T(opline->result.u.var), container, property, BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_W TSRMLS_CC);
if (0) {
zval_ptr_dtor(&property);
} else {
@@ -10154,10 +10277,10 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP
}
if (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
READY_TO_DESTROY(free_op1.var)) {
- AI_USE_PTR(EX_T(opline->result.u.var).var);
- if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) &&
- Z_REFCOUNT_PP(EX_T(opline->result.u.var).var.ptr_ptr) > 2) {
- SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr);
+ AI_USE_PTR(EX_T(opline->result.var).var);
+ if (!PZVAL_IS_REF(*EX_T(opline->result.var).var.ptr_ptr) &&
+ Z_REFCOUNT_PP(EX_T(opline->result.var).var.ptr_ptr) > 2) {
+ SEPARATE_ZVAL(EX_T(opline->result.var).var.ptr_ptr);
}
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
@@ -10171,8 +10294,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCOD
{
zend_op *opline = EX(opline);
zend_free_op free_op1, free_res;
- zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
- zval *property = &opline->op2.u.constant;
+ zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *property = opline->op2.zv;
if (IS_VAR == IS_CV) {
if (container != &EG(uninitialized_zval_ptr)) {
@@ -10185,7 +10308,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCOD
if (IS_VAR == IS_VAR && !container) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(&EX_T(opline->result.u.var), container, property, BP_VAR_UNSET TSRMLS_CC);
+ zend_fetch_property_address(&EX_T(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL), BP_VAR_UNSET TSRMLS_CC);
if (0) {
zval_ptr_dtor(&property);
} else {
@@ -10193,19 +10316,19 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCOD
}
if (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
READY_TO_DESTROY(free_op1.var)) {
- AI_USE_PTR(EX_T(opline->result.u.var).var);
- if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) &&
- Z_REFCOUNT_PP(EX_T(opline->result.u.var).var.ptr_ptr) > 2) {
- SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr);
+ AI_USE_PTR(EX_T(opline->result.var).var);
+ if (!PZVAL_IS_REF(*EX_T(opline->result.var).var.ptr_ptr) &&
+ Z_REFCOUNT_PP(EX_T(opline->result.var).var.ptr_ptr) > 2) {
+ SEPARATE_ZVAL(EX_T(opline->result.var).var.ptr_ptr);
}
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
- PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res);
- if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
- SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr);
+ PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res);
+ if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
+ SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.var).var.ptr_ptr);
}
- PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr);
+ PZVAL_LOCK(*EX_T(opline->result.var).var.ptr_ptr);
FREE_OP_VAR_PTR(free_res);
ZEND_VM_NEXT_OPCODE();
}
@@ -10215,8 +10338,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN
zend_op *opline = EX(opline);
zend_op *op_data = opline+1;
zend_free_op free_op1;
- zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
- zval *property_name = &opline->op2.u.constant;
+ zval **object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
+ zval *property_name = opline->op2.zv;
if (0) {
MAKE_REAL_ZVAL_PTR(property_name);
@@ -10224,7 +10347,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN
if (IS_VAR == IS_VAR && !object_ptr) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_assign_to_object(&opline->result, object_ptr, property_name, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, op_data->op1_type, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (0) {
zval_ptr_dtor(&property_name);
} else {
@@ -10241,19 +10364,19 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN
zend_op *opline = EX(opline);
zend_op *op_data = opline+1;
zend_free_op free_op1;
- zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+ zval **object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX(Ts), &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && !object_ptr) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
if (Z_TYPE_PP(object_ptr) == IS_OBJECT) {
- zval *property_name = &opline->op2.u.constant;
+ zval *property_name = opline->op2.zv;
if (0) {
MAKE_REAL_ZVAL_PTR(property_name);
}
- zend_assign_to_object(&opline->result, object_ptr, property_name, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, op_data->op1_type, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (0) {
zval_ptr_dtor(&property_name);
} else {
@@ -10262,29 +10385,29 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN
} else {
zend_free_op free_op_data1, free_op_data2;
zval *value;
- zval *dim = &opline->op2.u.constant;
+ zval *dim = opline->op2.zv;
zval **variable_ptr_ptr;
- zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC);
+ zend_fetch_dimension_address(&EX_T(op_data->op2.var), object_ptr, dim, IS_CONST, BP_VAR_W TSRMLS_CC);
- value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R);
- variable_ptr_ptr = _get_zval_ptr_ptr_var(&op_data->op2, EX(Ts), &free_op_data2 TSRMLS_CC);
+ value = get_zval_ptr(op_data->op1_type, &op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R);
+ variable_ptr_ptr = _get_zval_ptr_ptr_var(op_data->op2.var, EX(Ts), &free_op_data2 TSRMLS_CC);
if (!variable_ptr_ptr) {
- if (zend_assign_to_string_offset(&EX_T(op_data->op2.u.var), value, op_data->op1.op_type TSRMLS_CC)) {