From a7fc995fa2c4fb2af8ebe176b42524a95c9c46df Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 22 Jul 2014 16:11:54 +0200 Subject: [PATCH] Dead code --- Zend/zend_compile.c | 79 --------------------------------------------- Zend/zend_compile.h | 4 --- 2 files changed, 83 deletions(-) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 4b37613acf8..dd9b49bcf94 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3089,85 +3089,6 @@ void zend_add_to_list(void *result, void *item TSRMLS_DC) /* {{{ */ } /* }}} */ -void zend_do_declare_begin(TSRMLS_D) /* {{{ */ -{ - zend_stack_push(&CG(declare_stack), &CG(declarables)); -} -/* }}} */ - -void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC) /* {{{ */ -{ - if (!zend_binary_strcasecmp(Z_STRVAL(var->u.constant), Z_STRLEN(var->u.constant), "ticks", sizeof("ticks")-1)) { - convert_to_long(&val->u.constant); - CG(declarables).ticks = val->u.constant; - } else if (!zend_binary_strcasecmp(Z_STRVAL(var->u.constant), Z_STRLEN(var->u.constant), "encoding", sizeof("encoding")-1)) { - if (Z_TYPE(val->u.constant) == IS_CONSTANT) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot use constants as encoding"); - } - - /* - * Check that the pragma comes before any opcodes. If the compilation - * got as far as this, the previous portion of the script must have been - * parseable according to the .ini script_encoding setting. We still - * want to tell them to put declare() at the top. - */ - { - int num = CG(active_op_array)->last; - /* ignore ZEND_EXT_STMT and ZEND_TICKS */ - while (num > 0 && - (CG(active_op_array)->opcodes[num-1].opcode == ZEND_EXT_STMT || - CG(active_op_array)->opcodes[num-1].opcode == ZEND_TICKS)) { - --num; - } - - if (num > 0) { - zend_error_noreturn(E_COMPILE_ERROR, "Encoding declaration pragma must be the very first statement in the script"); - } - } - - if (CG(multibyte)) { - const zend_encoding *new_encoding, *old_encoding; - zend_encoding_filter old_input_filter; - - CG(encoding_declared) = 1; - - convert_to_string(&val->u.constant); - new_encoding = zend_multibyte_fetch_encoding(Z_STRVAL(val->u.constant) TSRMLS_CC); - if (!new_encoding) { - zend_error(E_COMPILE_WARNING, "Unsupported encoding [%s]", Z_STRVAL(val->u.constant)); - } else { - old_input_filter = LANG_SCNG(input_filter); - old_encoding = LANG_SCNG(script_encoding); - zend_multibyte_set_filter(new_encoding TSRMLS_CC); - - /* need to re-scan if input filter changed */ - if (old_input_filter != LANG_SCNG(input_filter) || - (old_input_filter && new_encoding != old_encoding)) { - zend_multibyte_yyinput_again(old_input_filter, old_encoding TSRMLS_CC); - } - } - } else { - zend_error(E_COMPILE_WARNING, "declare(encoding=...) ignored because Zend multibyte feature is turned off by settings"); - } - zval_dtor(&val->u.constant); - } else { - zend_error(E_COMPILE_WARNING, "Unsupported declare '%s'", Z_STRVAL(var->u.constant)); - zval_dtor(&val->u.constant); - } - zval_dtor(&var->u.constant); -} -/* }}} */ - -void zend_do_declare_end(const znode *declare_token TSRMLS_DC) /* {{{ */ -{ - zend_declarables *declarables = zend_stack_top(&CG(declare_stack)); - /* 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.op.opline_num) - ((Z_LVAL(CG(declarables).ticks))?1:0)) { - CG(declarables) = *declarables; - } -} -/* }}} */ - void zend_do_extended_info(TSRMLS_D) /* {{{ */ { zend_op *opline; diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index aa9a85bccd0..1402df53a3a 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -504,10 +504,6 @@ void zend_do_halt_compiler_register(TSRMLS_D); void zend_init_list(void *result, void *item TSRMLS_DC); void zend_add_to_list(void *result, void *item TSRMLS_DC); -void zend_do_declare_begin(TSRMLS_D); -void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC); -void zend_do_declare_end(const znode *declare_token TSRMLS_DC); - void zend_do_extended_info(TSRMLS_D); void zend_do_extended_fcall_begin(TSRMLS_D); void zend_do_extended_fcall_end(TSRMLS_D);