Skip to content

Commit d5faf44

Browse files
authored
Remove bogus tree setting code from parentnode/tree.c (#15044)
I don't know why this code was here in the first place, it is present since the initial implementation. It doesn't make sense because: 1. It would require updating the refcounts if the document wasn't actually already set. 2. We enforce that the document is the same as the target document by this point, so setting the tree is pointless.
1 parent c4546d4 commit d5faf44

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ext/dom/parentnode/tree.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,7 @@ xmlNode* dom_zvals_to_single_node(php_libxml_ref_obj *document, xmlNode *context
377377
xmlUnlinkNode(newNode);
378378
}
379379

380-
newNodeObj->document = document;
381-
xmlSetTreeDoc(newNode, documentNode);
380+
ZEND_ASSERT(newNodeObj->document == document);
382381

383382
if (newNode->type == XML_DOCUMENT_FRAG_NODE) {
384383
/* Unpack document fragment nodes, the behaviour differs for different libxml2 versions. */

0 commit comments

Comments
 (0)