cvs: ZendEngine2 / zend_compile.c zend_execute.c zend_object_handlers.c

From: Date: Wed, 05 Jun 2002 17:34:57 +0000
Subject: cvs: ZendEngine2 / zend_compile.c zend_execute.c zend_object_handlers.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-153@lists.php.net to get a copy of this message
andi Wed Jun 5 13:34:57 2002 EDT Modified files: /ZendEngine2 zend_compile.c zend_execute.c zend_object_handlers.c Log: - Allow overloaded objects to receive the method name in its original - case. Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.285 ZendEngine2/zend_compile.c:1.286 --- ZendEngine2/zend_compile.c:1.285 Tue Apr 23 14:06:53 2002 +++ ZendEngine2/zend_compile.c Wed Jun 5 13:34:56 2002 @@ -1081,8 +1081,6 @@ last_op->extended_value = ZEND_FETCH_FROM_THIS; } - zend_lowercase_znode_if_const(&last_op->op2); - left_bracket->u.constant.value.lval = ZEND_INIT_FCALL_BY_NAME; zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *)); Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.341 ZendEngine2/zend_execute.c:1.342 --- ZendEngine2/zend_execute.c:1.341 Wed May 8 14:43:19 2002 +++ ZendEngine2/zend_execute.c Wed Jun 5 13:34:56 2002 @@ -1892,30 +1892,15 @@ { zval *function_name; zval tmp; - zend_bool is_const; char *function_name_strval; int function_name_strlen; zend_ptr_stack_n_push(&EG(arg_types_stack), 2, EX(fbc), EX(object)); - is_const = (EX(opline)->op2.op_type == IS_CONST); + function_name = get_zval_ptr(&EX(opline)->op2, EX(Ts), &EG(free_op2), BP_VAR_R); + function_name_strval = function_name->value.str.val; + function_name_strlen = function_name->value.str.len; - if (is_const) { - function_name_strval = EX(opline)->op2.u.constant.value.str.val; - function_name_strlen = EX(opline)->op2.u.constant.value.str.len; - } else { - function_name = get_zval_ptr(&EX(opline)->op2, EX(Ts), &EG(free_op2), BP_VAR_R); - - tmp = *function_name; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - function_name = &tmp; - zend_str_tolower(tmp.value.str.val, tmp.value.str.len); - - function_name_strval = tmp.value.str.val; - function_name_strlen = tmp.value.str.len; - } - EX(calling_scope) = EG(scope); if (EX(opline)->extended_value == ZEND_FETCH_FROM_THIS) { @@ -1953,10 +1938,7 @@ EX(calling_scope) = NULL; } - if (!is_const) { - zval_dtor(&tmp); - FREE_OP(EX(Ts), &EX(opline)->op2, EG(free_op2)); - } + FREE_OP(EX(Ts), &EX(opline)->op2, EG(free_op2)); NEXT_OPCODE(); } Index: ZendEngine2/zend_object_handlers.c diff -u ZendEngine2/zend_object_handlers.c:1.6 ZendEngine2/zend_object_handlers.c:1.7 --- ZendEngine2/zend_object_handlers.c:1.6 Fri May 31 08:09:19 2002 +++ ZendEngine2/zend_object_handlers.c Wed Jun 5 13:34:56 2002 @@ -152,12 +152,19 @@ { zend_object *zobj; zend_function *func_method; - + char *lc_method_name; + + lc_method_name = do_alloca(method_len+1); + /* Create a zend_copy_str_tolower(dest, src, src_length); */ + memcpy(lc_method_name, method_name, method_len+1); + zend_str_tolower(lc_method_name, method_len); + zobj = Z_OBJ_P(object); - if(zend_hash_find(&zobj->ce->function_table, method_name, method_len+1, (void **)&func_method) == FAILURE) { + if(zend_hash_find(&zobj->ce->function_table, lc_method_name, method_len+1, (void **)&func_method) == FAILURE) { zend_error(E_ERROR, "Call to undefined function %s()", method_name); } - + + free_alloca(lc_method_name); return func_method; }

« previous php.zend-engine.cvs (#153) next »