aboutsummaryrefslogtreecommitdiffstats
path: root/main/libxml2/revert-Make-xmlFreeNodeList-non-recursive.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2019-12-02 15:38:42 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2019-12-02 15:41:12 +0000
commit902e71fcd3639928d27a16f9b8dbb2118ae15738 (patch)
treecfe86e24098f54d722376a084a2cb703a7c11e51 /main/libxml2/revert-Make-xmlFreeNodeList-non-recursive.patch
parent8022bb4b09eeb11d7fe081b4dceafc0e7dfa7192 (diff)
downloadaports-902e71fcd3639928d27a16f9b8dbb2118ae15738.tar.gz
aports-902e71fcd3639928d27a16f9b8dbb2118ae15738.tar.bz2
aports-902e71fcd3639928d27a16f9b8dbb2118ae15738.tar.xz
main/libxml2: revert upstream commit
revert upstream commit that makes xmlFreeNodeLists non-recursive. Reverting this fixes perl-xml-libxslt testsuite on 32 bit arches. Report at SUSE: https://bugzilla.suse.com/show_bug.cgi?id=1157450 Upstream report: https://github.com/shlomif/perl-XML-LibXSLT/issues/2
Diffstat (limited to 'main/libxml2/revert-Make-xmlFreeNodeList-non-recursive.patch')
-rw-r--r--main/libxml2/revert-Make-xmlFreeNodeList-non-recursive.patch64
1 files changed, 64 insertions, 0 deletions
diff --git a/main/libxml2/revert-Make-xmlFreeNodeList-non-recursive.patch b/main/libxml2/revert-Make-xmlFreeNodeList-non-recursive.patch
new file mode 100644
index 0000000000..102abdb313
--- /dev/null
+++ b/main/libxml2/revert-Make-xmlFreeNodeList-non-recursive.patch
@@ -0,0 +1,64 @@
+This is a revert of
+https://github.com/GNOME/libxml2/commit/0762c9b69ba01628f72eada1c64ff3d361fb5716
+
+This fixes perl-xml-libxslt test suite
+https://bugzilla.suse.com/show_bug.cgi?id=1157450
+
+diff --git a/tree.c b/tree.c
+index 08b1a50..f2b1457 100644
+--- a/tree.c
++++ b/tree.c
+@@ -3664,9 +3664,7 @@ xmlNextElementSibling(xmlNodePtr node) {
+ void
+ xmlFreeNodeList(xmlNodePtr cur) {
+ xmlNodePtr next;
+- xmlNodePtr parent;
+ xmlDictPtr dict = NULL;
+- size_t depth = 0;
+
+ if (cur == NULL) return;
+ if (cur->type == XML_NAMESPACE_DECL) {
+@@ -3682,21 +3680,16 @@ xmlFreeNodeList(xmlNodePtr cur) {
+ return;
+ }
+ if (cur->doc != NULL) dict = cur->doc->dict;
+- while (1) {
+- while ((cur->children != NULL) &&
+- (cur->type != XML_DTD_NODE) &&
+- (cur->type != XML_ENTITY_REF_NODE)) {
+- cur = cur->children;
+- depth += 1;
+- }
+-
++ while (cur != NULL) {
+ next = cur->next;
+- parent = cur->parent;
+ if (cur->type != XML_DTD_NODE) {
+
+ if ((__xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
+ xmlDeregisterNodeDefaultValue(cur);
+
++ if ((cur->children != NULL) &&
++ (cur->type != XML_ENTITY_REF_NODE))
++ xmlFreeNodeList(cur->children);
+ if (((cur->type == XML_ELEMENT_NODE) ||
+ (cur->type == XML_XINCLUDE_START) ||
+ (cur->type == XML_XINCLUDE_END)) &&
+@@ -3727,16 +3720,7 @@ xmlFreeNodeList(xmlNodePtr cur) {
+ DICT_FREE(cur->name)
+ xmlFree(cur);
+ }
+-
+- if (next != NULL) {
+- cur = next;
+- } else {
+- if ((depth == 0) || (parent == NULL))
+- break;
+- depth -= 1;
+- cur = parent;
+- cur->children = NULL;
+- }
++ cur = next;
+ }
+ }
+