summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/zend_compile.c8
1 files changed, 8 insertions, 0 deletions
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;
}