[no subject]

Before the patch, it xmlRemoveID would never work as in the following, cur
is an xmlIDPtr (which its attr property should be compared to attr, not
itself), so this function would always return -1.

    cur = xmlHashLookup(table, ID);
    if (cur != attr) {

The patch breaks  the regression tests due to the following:
xmlTextReaderFreeProp calls xmlRemoveID which now works and really removed
the xmlIDPtr from doc-ids.

During xmlValidateDocumentFinal, xmlValidateRef gets called from
The following block of code in xmlValidateRef fails (with the patch) for the
following reason:
id is now NULL as the ID has really been removed from the doc->ids table.
attr->parent does not exist as it was free'd a long time ago which ends up
segfaulting xmlNodeGetBase as
VECTXT passes in NULL for doc so xmlNodeGetBase uses attr->parent->doc which
we already establishes doesnt exist.

 id = xmlGetID(ctxt->doc, name);
 if (id == NULL) {
     VECTXT(ctxt, attr->parent);
    "IDREF attribute %s references an unknown ID \"%s\"\n",
     attr->name, name);
     ctxt->valid = 0;

Before the patch, as xmlRemoveID was not working correctly, when it is
called in xmlTextReaderFreeProp, the xmlIDPtr is not removed, so the  id =
xmlGetID(ctxt->doc, name); test from above would return a value.

I had looked at adding xmlRemoveRef right after the xmlRemoveID call in
xmlTextReaderFreeProp, when running the test however I get a lot of validity

Lastly, both xmlRemoveID and xmlRemoveRef use xmlHashUpdateEntry with a
xmlHashDeallocator passed in. This however wont decrease the table nbElems.
Is there a reason for using xmlHashUpdateEntry rather than



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]