GNOME Bugzilla – Bug 705391
Not reachable code in tree.c
Last modified: 2013-08-04 12:22:49 UTC
Created attachment 250756 [details] Removes the never reachable if-else condition In file : https://git.gnome.org/browse/libxml2/tree/tree.c Function : xmlDOMWrapNsMapAddItem At line : 7846 if ((position != -1) && (position != 0)) return(NULL); i.e if value of position can either be 1 or 0. Line: 7882 if (map->first == NULL) { ----Some COde ---- } else if (position == -1) { ---Some COde--- } else if (position == 0) { ----Some Code ---- } else return(NULL); In above if-else statements if map-first is not NULL then: one of the else-if condition will be executed as value of position can either be 1 or 0. So, the final else condition will never be executed. Patch for fix is attached.
*** This bug has been marked as a duplicate of bug 705392 ***