Hi Johannes,

It's not a bug. Just increment opline before return ZEND_USER_OPCODE_CONTINUE.

execute_data->opline++;

The user opcode can have additionl OP_DATA arguments or perform JMP, so it can't set next opline automatic.

Thanks. Dmitry.

Johannes Schlüter wrote:
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

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

Reply via email to