From: Zeev Suraski Date: Tue, 28 Jan 2003 11:34:24 +0000 (+0000) Subject: Fix a ticks related crash X-Git-Tag: RELEASE_0_5~1387 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=49fd22523839ac890b38aa40853ef346ecddcce7;p=php Fix a ticks related crash --- diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index f05ca5af2b..d975c5dbbf 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1700,6 +1700,10 @@ ZEND_API int do_bind_function(zend_op *opline, HashTable *function_table, HashTa { zend_function *function; + if (opline->opcode != ZEND_DECLARE_FUNCTION) { + zend_error(E_ERROR, "Internal compiler error. Please report!"); + } + 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) { int error_level = compile_time ? E_COMPILE_ERROR : E_ERROR; @@ -1789,6 +1793,10 @@ void zend_do_early_binding(TSRMLS_D) { zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1]; + while (opline->opcode == ZEND_TICKS && opline > CG(active_op_array)->opcodes) { + opline--; + } + if (do_bind_function(opline, CG(function_table), CG(class_table), 1) == FAILURE) { return; }