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
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Johannes,
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 guess that is exactly the required behaviour. How else do you want to
implement an user opcode that transfers control to another opline, like
a special kind of jump opcode.
Stefan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkmbJqwACgkQSuF5XhWr2njnzACgizi7a24c6GxNKTwMPU3SjvFF
KLQAnRz4w6i36ogEmT0LBofAjI5EiULP
=KDZK
-----END PGP SIGNATURE
Stefan,
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 guess that is exactly the required behaviour. How else do you want to
implement an user opcode that transfers control to another opline, like
a special kind of jump opcode.
ZEND_USER_OPCODE_DISPATCH_TO sounds like the way to do that. But we have
no clean API to set the next opcode and CONTINUE is documented as
#define ZEND_USER_OPCODE_CONTINUE 0 /* execute next opcode */
talking about the "next" one - so /some/ cleanup is needed.
johannes
Hi Johannes,
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.
Isn't that expected behaviour? If a normal opcode handler does not
increase the opline, simply returning will also cause re-execution of
the same handler again and again. Why should it be different for user
opcode handlers?
Regards,
Christian