summaryrefslogtreecommitdiff
path: root/ext/xml
diff options
context:
space:
mode:
authorThies C. Arntzen <thies@php.net>2001-02-15 13:41:04 +0000
committerThies C. Arntzen <thies@php.net>2001-02-15 13:41:04 +0000
commit72ec2e8f129fd07306ce3845dfc52a7520a4d559 (patch)
tree4ac26991bb01f7481107beb2c8abbe631b8643a1 /ext/xml
parentcd55dfa3bdb86b6c6fb03ab43b417fe9f05740d7 (diff)
downloadphp-git-72ec2e8f129fd07306ce3845dfc52a7520a4d559.tar.gz
fixed SEGFAULT when using xml_set_object. Zend does not yes support
cyclic references!
Diffstat (limited to 'ext/xml')
-rw-r--r--ext/xml/xml.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/ext/xml/xml.c b/ext/xml/xml.c
index 592ea09d2e..06c9749cd7 100644
--- a/ext/xml/xml.c
+++ b/ext/xml/xml.c
@@ -294,9 +294,11 @@ xml_parser_dtor(zend_rsrc_list_entry *rsrc)
{
xml_parser *parser = (xml_parser *)rsrc->ptr;
- if (parser->object) {
+ /* please leave this commented - or ask thies@thieso.net before doing it (again)
+ if (parser->object) {
zval_del_ref(&parser->object);
}
+ */
if (parser->parser) {
XML_ParserFree(parser->parser);
@@ -1175,19 +1177,19 @@ PHP_FUNCTION(xml_set_object)
RETURN_FALSE;
}
- if (! ParameterPassedByReference(ht,2)) {
- php_error(E_WARNING,"arg 2 not passed by reference");
- RETURN_FALSE;
- }
-
ZEND_FETCH_RESOURCE(parser,xml_parser *,pind, -1, "XML Parser", le_xml_parser);
- if (parser->object) {
+ /* please leave this commented - or ask thies@thieso.net before doing it (again)
+ if (parser->object) {
zval_del_ref(&parser->object);
}
+ */
parser->object = *mythis;
- zval_add_ref(&parser->object);
+
+ /* please leave this commented - or ask thies@thieso.net before doing it (again)
+ zval_add_ref(&parser->object);
+ */
RETVAL_TRUE;
}
@@ -1405,21 +1407,12 @@ PHP_FUNCTION(xml_parse_into_struct)
argc = ZEND_NUM_ARGS();
if (zend_get_parameters_ex(4, &pind, &data, &xdata,&info) == SUCCESS) {
- if (!ParameterPassedByReference(ht, 4)) {
- php_error(E_WARNING, "Array to be filled with values must be passed by reference.");
- RETURN_FALSE;
- }
zval_dtor(*info);
array_init(*info);
} else if (zend_get_parameters_ex(3, &pind, &data, &xdata) == FAILURE) {
WRONG_PARAM_COUNT;
}
- if (!ParameterPassedByReference(ht, 3)) {
- php_error(E_WARNING, "Array to be filled with values must be passed by reference.");
- RETURN_FALSE;
- }
-
ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser);
convert_to_string_ex(data);