[patch] Wrong cast to "xmlHashDeallocator" for "xmlSchemaBucketFree"

"doodad-js Admin" <[email protected]>
Newsgroups gmane.comp.gnome.lib.xml.general
Message-ID <[email protected]>
Hi,

 

When compiled with Emscripten, another function gets called instead of
"xmlSchemaBucketFree", leading to a bug. That's because Emscripten has a
function table per function signature. See file attachment for the patch.

 

 

Claude Petit

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
https://mail.gnome.org/mailman/listinfo/xml
xmlSchemaBucketDeallocator.patch (application/octet-stream, 753 B)
--- ../libxml2-2.9.4/xmlschemas.c	2017-07-09 15:25:04.823441753 -0400
+++ xmlschemas.c	2017-07-10 15:44:42.994414774 -0400
@@ -3556,6 +3556,11 @@
     xmlFree(bucket);
 }
 
+static void
+xmlSchemaBucketDeallocator(xmlSchemaBucketPtr bucket, xmlChar * name) {
+    xmlSchemaBucketFree(bucket);
+};
+
 static xmlSchemaBucketPtr
 xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt,
 			 int type, const xmlChar *targetNamespace)
@@ -4151,7 +4156,7 @@
 
     if (schema->schemasImports != NULL)
 	xmlHashFree(schema->schemasImports,
-		    (xmlHashDeallocator) xmlSchemaBucketFree);
+		    (xmlHashDeallocator) xmlSchemaBucketDeallocator);
     if (schema->includes != NULL) {
 	xmlSchemaItemListPtr list = (xmlSchemaItemListPtr) schema->includes;
 	int i;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.