cvs: ZendEngine2 / zend_compile.c zend_execute.c

From: Date: Thu, 29 Jul 2004 16:36:00 +0000
Subject: cvs: ZendEngine2 / zend_compile.c zend_execute.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-2815@lists.php.net to get a copy of this message
pollita Thu Jul 29 12:36:00 2004 EDT Modified files: /ZendEngine2 zend_compile.c zend_execute.c Log: Plug some memory leaks and promote unknown label to E_ERROR. If someone tries to jump to a non-existant label execution really shouldn't try to carry on. http://cvs.php.net/diff.php/ZendEngine2/zend_compile.c?r1=1.569&r2=1.570&ty=u Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.569 ZendEngine2/zend_compile.c:1.570 --- ZendEngine2/zend_compile.c:1.569 Thu Jul 29 11:23:47 2004 +++ ZendEngine2/zend_compile.c Thu Jul 29 12:36:00 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.569 2004/07/29 15:23:47 pollita Exp $ */ +/* $Id: zend_compile.c,v 1.570 2004/07/29 16:36:00 pollita Exp $ */ #include "zend_language_parser.h" #include "zend.h" @@ -3506,7 +3506,8 @@ SET_UNUSED(opline->op1); SET_UNUSED(opline->op2); - if (label->op_type == IS_CONST) { + if (label->op_type == IS_CONST && + label->u.constant.type == IS_STRING) { if (!CG(active_op_array)->labels) { CG(active_op_array)->labels = emalloc(sizeof(HashTable)); zend_hash_init(CG(active_op_array)->labels, 16, NULL, NULL, 0); @@ -3517,6 +3518,7 @@ /* Point to our newly created NOP instruction */ zend_hash_add(CG(active_op_array)->labels, label->u.constant.value.str.val, label->u.constant.value.str.len + 1, &opline, sizeof(zend_op*), NULL); } + zval_dtor(&label->u.constant); } else { zend_error(E_COMPILE_ERROR, "Invalid label identifier, expecting T_STRING"); } http://cvs.php.net/diff.php/ZendEngine2/zend_execute.c?r1=1.657&r2=1.658&ty=u Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.657 ZendEngine2/zend_execute.c:1.658 --- ZendEngine2/zend_execute.c:1.657 Thu Jul 29 11:23:47 2004 +++ ZendEngine2/zend_execute.c Thu Jul 29 12:36:00 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute.c,v 1.657 2004/07/29 15:23:47 pollita Exp $ */ +/* $Id: zend_execute.c,v 1.658 2004/07/29 16:36:00 pollita Exp $ */ #define ZEND_INTENSIVE_DEBUGGING 0 @@ -4080,11 +4080,13 @@ #if DEBUG_ZEND>=2 printf("Jumping on goto to opcode %08X\n", *target); #endif + zval_dtor(&tmp); SET_OPCODE(*target); return 0; } - zend_error(E_WARNING, "Unknown label %s", Z_STRVAL_P(label)); + zval_dtor(&tmp); + zend_error(E_ERROR, "Unknown label %s", Z_STRVAL_P(label)); NEXT_OPCODE(); }

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