I'm trying to pass a new structure into the ZEND_NEW handler which will be
used to change the behaviour of zend_fetch_class_by_name.
The issue I'm having though is the operands won't support the new type
unless I compile it to zval, but I can't use zend_execute_data to reference
that in a pre-handler since that appears to deal exclusively with function
calls.
op2 is taken on ZEND_NEW for the ctor skip, which is why I can't pass a new
zval directly to it. Is there another means I can pass the structure in?
Dominic
I think you are looking for opcode handlers, what you want to do is
implement a ZEND_NEW handler ...
For reference, xdebug and uopz overload handlers, as well as many other
extensions ...
Cheers
Joe
On Tue, Sep 29, 2015 at 3:47 PM, Dominic Grostate <
codekestrel@googlemail.com> wrote:
I'm trying to pass a new structure into the ZEND_NEW handler which will be
used to change the behaviour of zend_fetch_class_by_name.The issue I'm having though is the operands won't support the new type
unless I compile it to zval, but I can't use zend_execute_data to reference
that in a pre-handler since that appears to deal exclusively with function
calls.op2 is taken on ZEND_NEW for the ctor skip, which is why I can't pass a new
zval directly to it. Is there another means I can pass the structure in?Dominic
lxr: zend_set_user_opcode_handler
I think you are looking for opcode handlers, what you want to do is
implement a ZEND_NEW handler ...For reference, xdebug and uopz overload handlers, as well as many other
extensions ...Cheers
JoeOn Tue, Sep 29, 2015 at 3:47 PM, Dominic Grostate <
codekestrel@googlemail.com> wrote:I'm trying to pass a new structure into the ZEND_NEW handler which will be
used to change the behaviour of zend_fetch_class_by_name.The issue I'm having though is the operands won't support the new type
unless I compile it to zval, but I can't use zend_execute_data to
reference
that in a pre-handler since that appears to deal exclusively with function
calls.op2 is taken on ZEND_NEW for the ctor skip, which is why I can't pass a
new
zval directly to it. Is there another means I can pass the structure in?Dominic
Hi, ive already started working with the handlers. I've set up the parser
to accept addition syntax before the ctor. The type arguments are passed
to a new opcode handler which triggers prior to NEW but after FETCH_CLASS
(if dynamic, after resolve on CONST).
This needs to override the fetching of the class during the current NEW
handler, but to do that I need to supply addition data.
Do you know what I mean? I'm sorry if I'm explaining it badly.
lxr: zend_set_user_opcode_handler
On Tue, Sep 29, 2015 at 4:57 PM, Joe Watkins pthreads@pthreads.org
wrote:I think you are looking for opcode handlers, what you want to do is
implement a ZEND_NEW handler ...For reference, xdebug and uopz overload handlers, as well as many other
extensions ...Cheers
JoeOn Tue, Sep 29, 2015 at 3:47 PM, Dominic Grostate <
codekestrel@googlemail.com> wrote:I'm trying to pass a new structure into the ZEND_NEW handler which will
be
used to change the behaviour of zend_fetch_class_by_name.The issue I'm having though is the operands won't support the new type
unless I compile it to zval, but I can't use zend_execute_data to
reference
that in a pre-handler since that appears to deal exclusively with
function
calls.op2 is taken on ZEND_NEW for the ctor skip, which is why I can't pass a
new
zval directly to it. Is there another means I can pass the structure in?Dominic
Sorry, I'm not able to make sense of what you are doing ... got a patch ?
Cheers
Joe
On Tue, Sep 29, 2015 at 5:29 PM, Dominic Grostate <
codekestrel@googlemail.com> wrote:
Hi, ive already started working with the handlers. I've set up the
parser to accept addition syntax before the ctor. The type arguments are
passed to a new opcode handler which triggers prior to NEW but after
FETCH_CLASS (if dynamic, after resolve on CONST).This needs to override the fetching of the class during the current NEW
handler, but to do that I need to supply addition data.Do you know what I mean? I'm sorry if I'm explaining it badly.
lxr: zend_set_user_opcode_handler
On Tue, Sep 29, 2015 at 4:57 PM, Joe Watkins pthreads@pthreads.org
wrote:I think you are looking for opcode handlers, what you want to do is
implement a ZEND_NEW handler ...For reference, xdebug and uopz overload handlers, as well as many other
extensions ...Cheers
JoeOn Tue, Sep 29, 2015 at 3:47 PM, Dominic Grostate <
codekestrel@googlemail.com> wrote:I'm trying to pass a new structure into the ZEND_NEW handler which will
be
used to change the behaviour of zend_fetch_class_by_name.The issue I'm having though is the operands won't support the new type
unless I compile it to zval, but I can't use zend_execute_data to
reference
that in a pre-handler since that appears to deal exclusively with
function
calls.op2 is taken on ZEND_NEW for the ctor skip, which is why I can't pass a
new
zval directly to it. Is there another means I can pass the structure in?Dominic
https://github.com/orolyn/php-src/blob/generics/Zend/zend_vm_def.h
See opcode ZEND_TYPE_ARGUMENT.
I haven't built the type_argument_list yet, but once I have I will need to
pass it to the next op handler NEW. Where it will be passed to the
modified second parameter of zend_fetch_class_by_name().
That function will be changed to decide if an existing class should be
retrieved, or a new class should be dynamically created from a generic
template.
For now I'm focusing on figuring out how I can pass data around and this is
my current road block.
Sorry, I'm not able to make sense of what you are doing ... got a patch ?
Cheers
JoeOn Tue, Sep 29, 2015 at 5:29 PM, Dominic Grostate <
codekestrel@googlemail.com> wrote:Hi, ive already started working with the handlers. I've set up the
parser to accept addition syntax before the ctor. The type arguments are
passed to a new opcode handler which triggers prior to NEW but after
FETCH_CLASS (if dynamic, after resolve on CONST).This needs to override the fetching of the class during the current NEW
handler, but to do that I need to supply addition data.Do you know what I mean? I'm sorry if I'm explaining it badly.
lxr: zend_set_user_opcode_handler
On Tue, Sep 29, 2015 at 4:57 PM, Joe Watkins pthreads@pthreads.org
wrote:I think you are looking for opcode handlers, what you want to do is
implement a ZEND_NEW handler ...For reference, xdebug and uopz overload handlers, as well as many other
extensions ...Cheers
JoeOn Tue, Sep 29, 2015 at 3:47 PM, Dominic Grostate <
codekestrel@googlemail.com> wrote:I'm trying to pass a new structure into the ZEND_NEW handler which
will be
used to change the behaviour of zend_fetch_class_by_name.The issue I'm having though is the operands won't support the new type
unless I compile it to zval, but I can't use zend_execute_data to
reference
that in a pre-handler since that appears to deal exclusively with
function
calls.op2 is taken on ZEND_NEW for the ctor skip, which is why I can't pass
a new
zval directly to it. Is there another means I can pass the structure
in?Dominic