cvs: ZendEngine2 / zend_compile.c
| From: | Zeev Suraski | Date: | Tue, 28 Jan 2003 11:34:25 +0000 |
| Subject: | cvs: ZendEngine2 / zend_compile.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-850@lists.php.net to get a copy of this message | ||
zeev Tue Jan 28 06:34:25 2003 EDT
Modified files:
/ZendEngine2 zend_compile.c
Log:
Fix a ticks related crash
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.349 ZendEngine2/zend_compile.c:1.350
--- ZendEngine2/zend_compile.c:1.349 Mon Jan 27 10:13:01 2003
+++ ZendEngine2/zend_compile.c Tue Jan 28 06:34:24 2003
@@ -1700,6 +1700,10 @@
{
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;
@@ -1788,6 +1792,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;