Hi:
As dmitry said today, there is no way to get a user opcode
handler which can be called after a specific built-in handler.
So please expose zend_vm_get_opcde_handler. Before 5.4 release. :)
Thanks.
Sent from my iPad
Hi:
a patch for this proposal:
Index: zend_vm_gen.php
--- zend_vm_gen.php (revision 323168)
+++ zend_vm_gen.php (working copy)
@@ -797,7 +797,7 @@
if (ZEND_VM_OLD_EXECUTOR && $spec) {
out($f,"static int zend_vm_old_executor = 0;\n\n");
}
-
out($f,"static opcode_handler_t
zend_vm_get_opcode_handler(zend_uchar opcode, zend_op* op);\n\n");
-
out($f,"ZEND_API opcode_handler_t
zend_vm_get_opcode_handler(zend_uchar opcode, zend_op* op);\n\n");
switch ($kind) {
case ZEND_VM_KIND_CALL:
out($f,"\n");
@@ -1243,7 +1243,7 @@
}
// Generate zend_vm_get_opcode_handler() function
- out($f, "static opcode_handler_t
zend_vm_get_opcode_handler(zend_uchar opcode, zend_op* op)\n");
- out($f, "ZEND_API opcode_handler_t
zend_vm_get_opcode_handler(zend_uchar opcode, zend_op* op)\n");
out($f, "{\n");
if (!ZEND_VM_SPEC) {
out($f, "\treturn zend_opcode_handlers[opcode];\n");
Index: zend_vm_execute.h
===================================================================
--- zend_vm_execute.h (revision 323168)
+++ zend_vm_execute.h (working copy)
@@ -299,7 +299,7 @@
241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
};
-static opcode_handler_t zend_vm_get_opcode_handler(zend_uchar opcode,
zend_op* op);
+ZEND_API opcode_handler_t zend_vm_get_opcode_handler(zend_uchar
opcode, zend_op* op);
#undef OPLINE
@@ -40192,7 +40192,7 @@
};
zend_opcode_handlers = (opcode_handler_t*)labels;
}
-static opcode_handler_t zend_vm_get_opcode_handler(zend_uchar opcode,
zend_op* op)
+ZEND_API opcode_handler_t zend_vm_get_opcode_handler(zend_uchar
opcode, zend_op* op)
{
static const int zend_vm_decode[] = {
_UNUSED_CODE, /* 0 */
thanks
Hi:
As dmitry said today, there is no way to get a user opcode
handler which can be called after a specific built-in handler.So please expose zend_vm_get_opcde_handler. Before 5.4 release. :)
Thanks.
Sent from my iPad
--
惠新宸 laruence
Senior PHP Engineer
http://www.laruence.com
Hi!
Hi:
a patch for this proposal:
Don't see any problem with it. Dmitry, any issues you see with it?
If not, we can commit it.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
In general exposing zend_vm_get_opcode_handler() can't help.
You know that executor might be generated/compiled not only using
call-treading but also using switch or goto. In these cases
zend_vm_get_opcode_handler() won't return a function that could be called.
Thanks. Dmitry.
Hi!
Hi:
a patch for this proposal:Don't see any problem with it. Dmitry, any issues you see with it?
If not, we can commit it.
In general exposing zend_vm_get_opcode_handler() can't help.
You know that executor might be generated/compiled not only using
call-treading but also using switch or goto. In these cases
zend_vm_get_opcode_handler() won't return a function that could be called.
Hi:
sure, but I really need a way (even it's narrow) for my new extension..
or, should I make a patch to add a ZEND_USER_OPCODE_CALL_ME_LATER ?
thanks
Thanks. Dmitry.
Hi!
Hi:
a patch for this proposal:Don't see any problem with it. Dmitry, any issues you see with it?
If not, we can commit it.
--
惠新宸 laruence
Senior PHP Engineer
http://www.laruence.com
In general exposing zend_vm_get_opcode_handler() can't help.
You know that executor might be generated/compiled not only using
call-treading but also using switch or goto. In these cases
zend_vm_get_opcode_handler() won't return a function that could be called.
Hi:
sure, but I really need a way (even it's narrow) for my new extension..
Why I insistent this is there might be more than 80% php running
with-vm-kind=CALL
so expose this make sense for most of us.
but you really remind me, that I shoud also add a flag to detect what
the vm-kind now...
thanks
or, should I make a patch to add a ZEND_USER_OPCODE_CALL_ME_LATER ?
thanks
Thanks. Dmitry.
Hi!
Hi:
a patch for this proposal:Don't see any problem with it. Dmitry, any issues you see with it?
If not, we can commit it.--
惠新宸 laruence
Senior PHP Engineer
http://www.laruence.com
--
惠新宸 laruence
Senior PHP Engineer
http://www.laruence.com
Hi!
but you really remind me, that I shoud also add a flag to detect what
the vm-kind now...
Adding ZEND_API in one place is no problem, but any messing with the
engine is out of the question now.
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
Hi!
but you really remind me, that I shoud also add a flag to detect what
the vm-kind now...Adding ZEND_API in one place is no problem, but any messing with the engine
is out of the question now.
okey, let's just talk about adding ZEND_API. :)
thanks
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
--
惠新宸 laruence
Senior PHP Engineer
http://www.laruence.com
Hi!
okey, let's just talk about adding ZEND_API. :)
But as Dmitry noted, it's only present in one model, so how useful would
it be? I don't want to add patches that are not beneficial for anything
but a very narrow use case. Could you explain what are you trying to do?
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
Hi!
okey, let's just talk about adding ZEND_API. :)
But as Dmitry noted, it's only present in one model, so how useful would it
be? I don't want to add patches that are not beneficial for anything but a
very narrow use case. Could you explain what are you trying to do?
okey, I am woking on a extension : taint
(https://github.com/laruence/php-ext-taint) , I need find a way to
set a handler which will be called after some built-in handler
like:
$a = "taint string";
then
$b .= $a ; //should also be a taint string.
as the code above shows, I need call ASSIGN_CONCAT first then edit
the result of the last opline.
but now I can not do it unless copy the origin handler and all it
denpend codes, then call it myself (which is what I did now)...
thanks
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
--
惠新宸 laruence
Senior PHP Engineer
http://www.laruence.com
Hi:
after got some advise of dmitry on IRC, I decide to drawback this proposal.
and try to find a much better patch later.
thanks very much, and sorry for noise.
thanks
Hi!
okey, let's just talk about adding ZEND_API. :)
But as Dmitry noted, it's only present in one model, so how useful would it
be? I don't want to add patches that are not beneficial for anything but a
very narrow use case. Could you explain what are you trying to do?
okey, I am woking on a extension : taint
(https://github.com/laruence/php-ext-taint) , I need find a way to
set a handler which will be called after some built-in handlerlike:
$a = "taint string";
then
$b .= $a ; //should also be a taint string.as the code above shows, I need call ASSIGN_CONCAT first then edit
the result of the last opline.but now I can not do it unless copy the origin handler and all it
denpend codes, then call it myself (which is what I did now)...thanks
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227--
惠新宸 laruence
Senior PHP Engineer
http://www.laruence.com
--
惠新宸 laruence
Senior PHP Engineer
http://www.laruence.com