[php] Fix -prefix when there are subclasses
The calls to the parent class' magic __get, __set and __isset methods weren't getting the prefix.
This commit is contained in:
parent
4ca4283d33
commit
ead90be779
3 changed files with 10 additions and 4 deletions
|
|
@ -5,7 +5,7 @@ require "tests.php";
|
||||||
// No new functions
|
// No new functions
|
||||||
check::functions(array());
|
check::functions(array());
|
||||||
// New classes
|
// New classes
|
||||||
check::classes(array('ProjectFoo'));
|
check::classes(array('ProjectBar','ProjectFoo'));
|
||||||
// No new vars
|
// No new vars
|
||||||
check::globals(array());
|
check::globals(array());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,4 +11,10 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// This failed in git pre 4.1.0 - the calls to the parent class' magic __get,
|
||||||
|
// __set and __isset methods weren't getting the prefix.
|
||||||
|
class Bar : public Foo {
|
||||||
|
public:
|
||||||
|
};
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
|
||||||
|
|
@ -941,7 +941,7 @@ public:
|
||||||
}
|
}
|
||||||
Printf(f->code, "} else {\n");
|
Printf(f->code, "} else {\n");
|
||||||
if (base_class) {
|
if (base_class) {
|
||||||
Printf(f->code, "PHP_MN(%s___set)(INTERNAL_FUNCTION_PARAM_PASSTHRU);\n}\n", base_class);
|
Printf(f->code, "PHP_MN(%s%s___set)(INTERNAL_FUNCTION_PARAM_PASSTHRU);\n}\n", prefix, base_class);
|
||||||
} else {
|
} else {
|
||||||
Printf(f->code, "add_property_zval_ex(ZEND_THIS, ZSTR_VAL(arg2), ZSTR_LEN(arg2), &args[1]);\n}\n");
|
Printf(f->code, "add_property_zval_ex(ZEND_THIS, ZSTR_VAL(arg2), ZSTR_LEN(arg2), &args[1]);\n}\n");
|
||||||
}
|
}
|
||||||
|
|
@ -974,7 +974,7 @@ public:
|
||||||
Printf(f->code, "if(arg->newobject) {\nRETVAL_LONG(1);\n}\nelse {\nRETVAL_LONG(0);\n}\n}\n\n");
|
Printf(f->code, "if(arg->newobject) {\nRETVAL_LONG(1);\n}\nelse {\nRETVAL_LONG(0);\n}\n}\n\n");
|
||||||
Printf(f->code, "else {\n");
|
Printf(f->code, "else {\n");
|
||||||
if (base_class) {
|
if (base_class) {
|
||||||
Printf(f->code, "PHP_MN(%s___get)(INTERNAL_FUNCTION_PARAM_PASSTHRU);\n}\n", base_class);
|
Printf(f->code, "PHP_MN(%s%s___get)(INTERNAL_FUNCTION_PARAM_PASSTHRU);\n}\n", prefix, base_class);
|
||||||
} else {
|
} else {
|
||||||
// __get is only called if the property isn't set on the zend_object.
|
// __get is only called if the property isn't set on the zend_object.
|
||||||
Printf(f->code, "RETVAL_NULL();\n}\n");
|
Printf(f->code, "RETVAL_NULL();\n}\n");
|
||||||
|
|
@ -1008,7 +1008,7 @@ public:
|
||||||
}
|
}
|
||||||
Printf(f->code, "else {\n");
|
Printf(f->code, "else {\n");
|
||||||
if (base_class) {
|
if (base_class) {
|
||||||
Printf(f->code, "PHP_MN(%s___isset)(INTERNAL_FUNCTION_PARAM_PASSTHRU);\n}\n", base_class);
|
Printf(f->code, "PHP_MN(%s%s___isset)(INTERNAL_FUNCTION_PARAM_PASSTHRU);\n}\n", prefix, base_class);
|
||||||
} else {
|
} else {
|
||||||
// __isset is only called if the property isn't set on the zend_object.
|
// __isset is only called if the property isn't set on the zend_object.
|
||||||
Printf(f->code, "RETVAL_FALSE;\n}\n");
|
Printf(f->code, "RETVAL_FALSE;\n}\n");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue