Hi,

while implementing a small toy extension (see [1]) I found out that
ZEND_USER_OPCODE_CONTINUE seems to misbehave as it doesn't go to the
next opcode so I ended up in an endless loop executing the same opcode
again and again.

I'm not sure whether we should change the behavior, using a trivial
patch like the attached one or whether we should add a
ZEND_USER_OPCODE_NEXT_OPCODE constant. The first approach looks nicer to
me but might break extensions working around that problem in a hard to
track way (skipping an opcode)

Ideas, comments?

johannes

[1] http://news.php.net/php.pecl.dev/6117 
Index: Zend/zend_vm_def.h
===================================================================
RCS file: /repository/ZendEngine2/zend_vm_def.h,v
retrieving revision 1.59.2.29.2.48.2.84
diff -u -p -r1.59.2.29.2.48.2.84 zend_vm_def.h
--- Zend/zend_vm_def.h	26 Jan 2009 22:54:20 -0000	1.59.2.29.2.48.2.84
+++ Zend/zend_vm_def.h	17 Feb 2009 20:55:32 -0000
@@ -4338,7 +4338,7 @@ ZEND_VM_HANDLER(150, ZEND_USER_OPCODE, A
 
 	switch (ret) {
 		case ZEND_USER_OPCODE_CONTINUE:
-			ZEND_VM_CONTINUE();
+			ZEND_VM_NEXT_OPCODE();
 		case ZEND_USER_OPCODE_RETURN:
 			ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
 		case ZEND_USER_OPCODE_DISPATCH:

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to