cvs: ZendEngine2 / zend_compile.c

From: Date: Wed, 16 Jul 2003 09:13:47 +0000
Subject: cvs: ZendEngine2 / zend_compile.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-1477@lists.php.net to get a copy of this message
zeev Wed Jul 16 05:13:47 2003 EDT Modified files: /ZendEngine2 zend_compile.c Log: Fix bug in the verification of interface-function implementation Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.437 ZendEngine2/zend_compile.c:1.438 --- ZendEngine2/zend_compile.c:1.437 Wed Jul 16 04:57:08 2003 +++ ZendEngine2/zend_compile.c Wed Jul 16 05:13:47 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.437 2003/07/16 08:57:08 zeev Exp $ */ +/* $Id: zend_compile.c,v 1.438 2003/07/16 09:13:47 zeev Exp $ */ #include "zend_language_parser.h" #include "zend.h" @@ -1676,6 +1676,7 @@ op = fe->op_array.opcodes; proto_op = fe->common.prototype->op_array.opcodes; + /* Make sure that the implementation has all of the arguments of the interface */ while (proto_op->opcode != ZEND_RAISE_ABSTRACT_ERROR) { if (proto_op->opcode != op->opcode) { return 0; @@ -1690,7 +1691,21 @@ proto_op++; op++; } - return 1; + + /* Make sure that the implementation doesn't receive more arguments than the interface */ + while (1) { + switch (op->opcode) { + case ZEND_FETCH_CLASS: + case ZEND_FETCH_W: + op++; + break; + case ZEND_RECV: + case ZEND_RECV_INIT: + return 0; + default: + return 1; + } + } }

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