Re: [xml] Possible 64-bit issues in xml 2.9.2

On 11 Nov 2015, at 11:00, Nick Wellnhofer <wellnhofer aevum de> wrote:

    if (node2->type == XML_ELEMENT_NODE) {
if ((0 > (long) node1->content) && /* TODO: Would a != 0 suffice here? */
    (0 > (long) node2->content) &&

The intent is not entirely clear but if these are supposed to be NULL checks
then they could easily give the wrong result.

Just to clarify: The values stored in node->content are actually integers used to speed up node 
comparisons. See xmlXPathOrderDocElems:

In which case you probably want intptr_t and this macro:

If stdint.h or inttypes.h defines the type intptr_t, define HAVE_INTPTR_T. Otherwise, define intptr_t to a 
signed integer type wide enough to hold a pointer, if such a type exists.

Alex Bligh

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